ui: clean up more generic forms, remove is_login everywhere

This commit is contained in:
Jens Langhammer
2020-02-21 15:00:45 +01:00
parent ea6a1422f7
commit b6326f399c
22 changed files with 423 additions and 239 deletions

View File

@ -74,11 +74,6 @@ class PassbookAuthorizationView(AccessMixin, AuthorizationView):
LOGGER.debug(request.GET.get("redirect_uri"))
return actual_response
def render_to_response(self, context, **kwargs):
# Always set is_login to true for correct css class
context["is_login"] = True
return super().render_to_response(context, **kwargs)
def form_valid(self, form):
# User has clicked on "Authorize"
Event.new(

View File

@ -66,10 +66,7 @@ class AccessRequiredView(AccessMixin, View):
return render(
request,
"login/denied.html",
{
"title": _("You don't have access to this application"),
"is_login": True,
},
{"title": _("You don't have access to this application"),},
)
return super().dispatch(request, *args, **kwargs)
@ -142,12 +139,7 @@ class LoginProcessView(AccessRequiredView):
return render(
request,
"saml/idp/login.html",
{
"saml_params": params,
"provider": self.provider,
# This is only needed to for the template to render correctly
"is_login": True,
},
{"saml_params": params, "provider": self.provider,},
)
except exceptions.CannotHandleAssertion as exc:
@ -308,10 +300,5 @@ class InitiateLoginView(AccessRequiredView):
return render(
request,
"saml/idp/login.html",
{
"saml_params": params,
"provider": self.provider,
# This is only needed to for the template to render correctly
"is_login": True,
},
{"saml_params": params, "provider": self.provider,},
)