mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
b5fb67ee76
commit
b7d6ca12e8
@ -155,6 +155,7 @@ class QueryCountMiddleware(object):
|
|||||||
|
|
||||||
url_matcher = url('', include(frontendpatterns))
|
url_matcher = url('', include(frontendpatterns))
|
||||||
|
|
||||||
|
|
||||||
class Check2FAMiddleware(BaseRequire2FAMiddleware):
|
class Check2FAMiddleware(BaseRequire2FAMiddleware):
|
||||||
"""check if user is required to have MFA enabled"""
|
"""check if user is required to have MFA enabled"""
|
||||||
def require_2fa(self, request):
|
def require_2fa(self, request):
|
||||||
@ -166,6 +167,7 @@ class Check2FAMiddleware(BaseRequire2FAMiddleware):
|
|||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class CustomAllauthTwoFactorMiddleware(AllauthTwoFactorMiddleware):
|
class CustomAllauthTwoFactorMiddleware(AllauthTwoFactorMiddleware):
|
||||||
"""This function ensures only frontend code triggers the MFA auth cycle"""
|
"""This function ensures only frontend code triggers the MFA auth cycle"""
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
|
@ -29,7 +29,6 @@ from allauth.socialaccount.forms import DisconnectForm
|
|||||||
from allauth.account.models import EmailAddress
|
from allauth.account.models import EmailAddress
|
||||||
from allauth.account.views import EmailView, PasswordResetFromKeyView
|
from allauth.account.views import EmailView, PasswordResetFromKeyView
|
||||||
from allauth.socialaccount.views import ConnectionsView
|
from allauth.socialaccount.views import ConnectionsView
|
||||||
from allauth_2fa.views import TwoFactorAuthenticate
|
|
||||||
|
|
||||||
from common.settings import currency_code_default, currency_codes
|
from common.settings import currency_code_default, currency_codes
|
||||||
|
|
||||||
@ -778,7 +777,6 @@ class CustomPasswordResetFromKeyView(PasswordResetFromKeyView):
|
|||||||
success_url = reverse_lazy("account_login")
|
success_url = reverse_lazy("account_login")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CurrencyRefreshView(RedirectView):
|
class CurrencyRefreshView(RedirectView):
|
||||||
"""
|
"""
|
||||||
POST endpoint to refresh / update exchange rates
|
POST endpoint to refresh / update exchange rates
|
||||||
|
Loading…
Reference in New Issue
Block a user