diff --git a/authentik/core/templates/if/end_session.html b/authentik/core/templates/if/end_session.html index 5dbc26898..9d98f1af4 100644 --- a/authentik/core/templates/if/end_session.html +++ b/authentik/core/templates/if/end_session.html @@ -3,16 +3,6 @@ {% load static %} {% load i18n %} -{% block head %} -{{ block.super }} - -{% endblock %} - {% block title %} {% trans 'End session' %} - {{ tenant.branding_title }} {% endblock %} diff --git a/authentik/flows/api/flows.py b/authentik/flows/api/flows.py index 48b0fd23e..3ec01cc2f 100644 --- a/authentik/flows/api/flows.py +++ b/authentik/flows/api/flows.py @@ -303,8 +303,12 @@ class FlowViewSet(UsedByMixin, ModelViewSet): background = request.FILES.get("file", None) clear = request.data.get("clear", False) if clear: - # .delete() saves the model by default - flow.background.delete() + if flow.background_url.startswith("/media"): + # .delete() saves the model by default + flow.background.delete() + else: + flow.background = None + flow.save() return Response({}) if background: flow.background = background