mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2025-02-17 18:15:39 +00:00
Use ruff
This commit is contained in:
parent
e4e22b5dd3
commit
897f3c57f8
3 changed files with 8 additions and 5 deletions
|
@ -1,9 +1,5 @@
|
||||||
# AdvLabDB
|
# AdvLabDB
|
||||||
|
|
||||||
[](https://github.com/psf/black)
|
|
||||||
[](https://pycqa.github.io/isort/)
|
|
||||||
[](https://github.com/PyCQA/bandit)
|
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
AdvLabDB is a database with a web interface for labs.
|
AdvLabDB is a database with a web interface for labs.
|
||||||
|
|
|
@ -14,6 +14,7 @@ def update_final_experiment_and_part_marks():
|
||||||
|
|
||||||
flash("Manually updated all final experiment and part marks.", "success")
|
flash("Manually updated all final experiment and part marks.", "success")
|
||||||
|
|
||||||
|
|
||||||
def backup(backup_prefix):
|
def backup(backup_prefix):
|
||||||
db_path = data_dir / "db/advlabdb.sqlite"
|
db_path = data_dir / "db/advlabdb.sqlite"
|
||||||
|
|
||||||
|
@ -29,9 +30,11 @@ def backup(backup_prefix):
|
||||||
else:
|
else:
|
||||||
flash("Failed to create a database backup! Make sure that `sqlite3` is installed on your system!", "danger")
|
flash("Failed to create a database backup! Make sure that `sqlite3` is installed on your system!", "danger")
|
||||||
|
|
||||||
|
|
||||||
def manual_backup():
|
def manual_backup():
|
||||||
backup("manual")
|
backup("manual")
|
||||||
|
|
||||||
|
|
||||||
def deactivate_assistants():
|
def deactivate_assistants():
|
||||||
user_ids_to_deactivate = db.session.scalars(
|
user_ids_to_deactivate = db.session.scalars(
|
||||||
select(Assistant.user_id)
|
select(Assistant.user_id)
|
||||||
|
|
|
@ -26,9 +26,13 @@ sqlalchemy = "<2"
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
[tool.black]
|
[tool.ruff]
|
||||||
|
select = ["E1", "E4", "E7", "E9", "W", "F", "I", "UP"]
|
||||||
line-length = 120
|
line-length = 120
|
||||||
|
|
||||||
|
[tool.ruff.per-file-ignores]
|
||||||
|
"__init__.py" = ["I"]
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
profile = "black"
|
profile = "black"
|
||||||
skip = ["__init__.py"]
|
skip = ["__init__.py"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue