diff --git a/authentik/core/api/applications.py b/authentik/core/api/applications.py index 055b07214..706ee400c 100644 --- a/authentik/core/api/applications.py +++ b/authentik/core/api/applications.py @@ -202,7 +202,7 @@ class ApplicationViewSet(UsedByMixin, ModelViewSet): """Set application icon""" app: Application = self.get_object() icon = request.FILES.get("file", None) - clear = request.data.get("clear", False) + clear = request.data.get("clear", "false").lower() == "true" if clear: # .delete() saves the model by default app.meta_icon.delete() diff --git a/authentik/flows/api/flows.py b/authentik/flows/api/flows.py index 3ec01cc2f..21bedfcd6 100644 --- a/authentik/flows/api/flows.py +++ b/authentik/flows/api/flows.py @@ -301,7 +301,7 @@ class FlowViewSet(UsedByMixin, ModelViewSet): """Set Flow background""" flow: Flow = self.get_object() background = request.FILES.get("file", None) - clear = request.data.get("clear", False) + clear = request.data.get("clear", "false").lower() == "true" if clear: if flow.background_url.startswith("/media"): # .delete() saves the model by default