Skip to content

Commit

Permalink
Make login disable check overrideable
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Aug 3, 2024
1 parent 4c7b755 commit 6a385a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion misago/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LoginView(View):
form_type = AuthenticationForm

def dispatch(self, request: HttpRequest, **kwargs) -> HttpResponse:
if is_misago_login_page_disabled():
if self.is_view_disabled():
raise Http404()

if request.user.is_authenticated:
Expand Down Expand Up @@ -78,6 +78,9 @@ def render(

return render(request, self.template_name, context)

def is_view_disabled(self) -> bool:
return is_misago_login_page_disabled()


login = sensitive_post_parameters()(never_cache(LoginView.as_view()))

Expand Down

0 comments on commit 6a385a9

Please sign in to comment.