mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-03 22:43:11 -05:00
chores: updates-and-linters (#1868)
* switch to ruff * add ruff * run ruff --fix * update ruff * resolve ruff errors * drop isort from CI * fix decorator order
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from datetime import date
|
||||
from functools import cached_property
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
|
||||
@@ -84,15 +83,17 @@ class GroupMealplanController(BaseUserController):
|
||||
return self.mixins.create_one(
|
||||
SavePlanEntry(date=data.date, entry_type=data.entry_type, recipe_id=recipe.id, group_id=self.group_id)
|
||||
)
|
||||
except IndexError:
|
||||
raise HTTPException(status_code=404, detail=ErrorResponse.respond(message="No recipes match your rules"))
|
||||
except IndexError as e:
|
||||
raise HTTPException(
|
||||
status_code=404, detail=ErrorResponse.respond(message="No recipes match your rules")
|
||||
) from e
|
||||
|
||||
@router.get("", response_model=PlanEntryPagination)
|
||||
def get_all(
|
||||
self,
|
||||
q: PaginationQuery = Depends(PaginationQuery),
|
||||
start_date: Optional[date] = None,
|
||||
end_date: Optional[date] = None,
|
||||
start_date: date | None = None,
|
||||
end_date: date | None = None,
|
||||
):
|
||||
# merge start and end dates into pagination query only if either is provided
|
||||
if start_date or end_date:
|
||||
|
||||
@@ -45,7 +45,7 @@ class GroupMigrationController(BaseUserController):
|
||||
|
||||
migrator: BaseMigrator
|
||||
|
||||
match migration_type:
|
||||
match migration_type: # noqa match not supported by ruff
|
||||
case SupportedMigrations.chowdown:
|
||||
migrator = ChowdownMigrator(**args)
|
||||
case SupportedMigrations.mealie_alpha:
|
||||
|
||||
Reference in New Issue
Block a user