mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue