Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix templates #22

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add STATIC_URL in middleware exclude
  • Loading branch information
lsaavedr committed Jul 30, 2024
commit 3069e76c286670bb42287d9aef53ff5a7b3d5a29
2 changes: 2 additions & 0 deletions mfa/middleware.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin

Expand All @@ -6,6 +7,7 @@ class MFAEnforceMiddleware(MiddlewareMixin):
def process_view(self, request, view_func, view_args, view_kwargs):
if (
not getattr(view_func, 'mfa_public', False)
and not request.path.startswith(settings.STATIC_URL)
and request.user.is_authenticated
and not request.user.mfakey_set.exists()
):
Expand Down