mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-08 06:55:24 +02:00
fix: Lint Python code with ruff (#3799)
This commit is contained in:
parent
65ece35966
commit
432914e310
41 changed files with 112 additions and 120 deletions
|
@ -25,7 +25,7 @@ from mealie.services.backups_v2.backup_v2 import BackupV2
|
|||
def dict_sorter(d: dict) -> Any:
|
||||
possible_keys = {"created_at", "id"}
|
||||
|
||||
return next((d[key] for key in possible_keys if key in d and d[key]), 1)
|
||||
return next((d[key] for key in possible_keys if d.get(key)), 1)
|
||||
|
||||
|
||||
# For Future Use
|
||||
|
@ -68,7 +68,7 @@ def test_database_restore():
|
|||
new_exporter = AlchemyExporter(settings.DB_URL)
|
||||
snapshop_2 = new_exporter.dump()
|
||||
|
||||
for s1, s2 in zip(snapshop_1, snapshop_2):
|
||||
for s1, s2 in zip(snapshop_1, snapshop_2, strict=False):
|
||||
assert snapshop_1[s1].sort(key=dict_sorter) == snapshop_2[s2].sort(key=dict_sorter)
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ def test_get_locked_users(database: AllRepositories, user_tuple: list[TestUser])
|
|||
elif locked_user.id == user_2.id:
|
||||
assert locked_user.locked_at == user_2.locked_at
|
||||
else:
|
||||
assert False
|
||||
raise AssertionError()
|
||||
|
||||
# Cleanup
|
||||
user_service.unlock_user(user_1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue