fix: accept icon type in app icon updates (#35360)

Co-authored-by: Stephen Zhou <hi@hyoban.cc>
This commit is contained in:
hyl64
2026-04-20 02:33:49 +00:00
committed by GitHub
co-authored by Stephen Zhou
parent d81444683b
commit ceec00e172
4 changed files with 45 additions and 3 deletions
+6 -1
View File
@@ -303,17 +303,22 @@ class AppService:
return app
def update_app_icon(self, app: App, icon: str, icon_background: str) -> App:
def update_app_icon(
self, app: App, icon: str, icon_background: str, icon_type: IconType | str | None = None
) -> App:
"""
Update app icon
:param app: App instance
:param icon: new icon
:param icon_background: new icon_background
:param icon_type: new icon type
:return: App instance
"""
assert current_user is not None
app.icon = icon
app.icon_background = icon_background
if icon_type is not None:
app.icon_type = icon_type if isinstance(icon_type, IconType) else IconType(icon_type)
app.updated_by = current_user.id
app.updated_at = naive_utc_now()
db.session.commit()