mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
fix: accept icon type in app icon updates (#35360)
Co-authored-by: Stephen Zhou <hi@hyoban.cc>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user