mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-04 22:40:30 +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
|
||||
|
||||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
|
||||
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
|
||||
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
|
||||
|
||||
## About
|
||||
|
||||
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")
|
||||
|
||||
|
||||
def backup(backup_prefix):
|
||||
db_path = data_dir / "db/advlabdb.sqlite"
|
||||
|
||||
|
@ -29,9 +30,11 @@ def backup(backup_prefix):
|
|||
else:
|
||||
flash("Failed to create a database backup! Make sure that `sqlite3` is installed on your system!", "danger")
|
||||
|
||||
|
||||
def manual_backup():
|
||||
backup("manual")
|
||||
|
||||
|
||||
def deactivate_assistants():
|
||||
user_ids_to_deactivate = db.session.scalars(
|
||||
select(Assistant.user_id)
|
||||
|
|
|
@ -26,9 +26,13 @@ sqlalchemy = "<2"
|
|||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.black]
|
||||
[tool.ruff]
|
||||
select = ["E1", "E4", "E7", "E9", "W", "F", "I", "UP"]
|
||||
line-length = 120
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"__init__.py" = ["I"]
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
skip = ["__init__.py"]
|
||||
|
|
Loading…
Reference in a new issue