fixup
This commit is contained in:
dni ⚡ 2023-05-04 17:22:24 +02:00 committed by GitHub
parent 7feac3bb5e
commit 3c92ef2900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,14 @@ async def api_get_settings(
@core_app.put(
"/admin/api/v1/settings/",
status_code=HTTPStatus.OK,
dependencies=[Depends(check_admin)],
)
async def api_update_settings(data: EditableSettings):
async def api_update_settings(
data: EditableSettings, user: User = Depends(check_admin)
):
await update_admin_settings(data)
update_cached_settings(dict(data))
admin_settings = await get_admin_settings(user.super_user)
assert admin_settings, "Updated admin settings not found."
update_cached_settings(admin_settings.dict())
return {"status": "Success"}