diff --git a/README.md b/README.md index c0d19bc..3b069bf 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/advlabdb/actions.py b/advlabdb/actions.py index 20c4312..19cc2ba 100644 --- a/advlabdb/actions.py +++ b/advlabdb/actions.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index d581525..c87c860 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]