mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-09 01:13:10 -05:00
prs-fleshgolem-2070: feat: sqlalchemy 2.0 (#2096)
* upgrade sqlalchemy to 2.0 * rewrite all db models to sqla 2.0 mapping api * fix some importing and typing weirdness * fix types of a lot of nullable columns * remove get_ref methods * fix issues found by tests * rewrite all queries in repository_recipe to 2.0 style * rewrite all repository queries to 2.0 api * rewrite all remaining queries to 2.0 api * remove now-unneeded __allow_unmapped__ flag * remove and fix some unneeded cases of "# type: ignore" * fix formatting * bump black version * run black * can this please be the last one. okay. just. okay. * fix repository errors * remove return * drop open API validator --------- Co-authored-by: Sören Busch <fleshgolem@gmx.net>
This commit is contained in:
@@ -37,7 +37,6 @@ class HttpRepo(Generic[C, R, U]):
|
||||
exception_msgs: Callable[[type[Exception]], str] | None = None,
|
||||
default_message: str | None = None,
|
||||
) -> None:
|
||||
|
||||
self.repo = repo
|
||||
self.logger = logger
|
||||
self.exception_msgs = exception_msgs
|
||||
|
||||
@@ -39,7 +39,6 @@ class AdminAboutController(BaseAdminController):
|
||||
|
||||
@router.get("/statistics", response_model=AppStatistics)
|
||||
def get_app_statistics(self):
|
||||
|
||||
return AppStatistics(
|
||||
total_recipes=self.repos.recipes.count_all(),
|
||||
uncategorized_recipes=self.repos.recipes.count_uncategorized(), # type: ignore
|
||||
|
||||
@@ -85,7 +85,6 @@ class AdminMaintenanceController(BaseAdminController):
|
||||
|
||||
@router.get("/logs", response_model=MaintenanceLogs)
|
||||
def get_logs(self, lines: int = 200):
|
||||
|
||||
return MaintenanceLogs(logs=tail_log(LOGGER_FILE, lines))
|
||||
|
||||
@router.get("/storage", response_model=MaintenanceStorageDetails)
|
||||
|
||||
@@ -49,7 +49,6 @@ class MealieAuthToken(BaseModel):
|
||||
|
||||
@public_router.post("/token")
|
||||
def get_token(data: CustomOAuth2Form = Depends(), session: Session = Depends(generate_session)):
|
||||
|
||||
email = data.username
|
||||
password = data.password
|
||||
|
||||
|
||||
Reference in New Issue
Block a user