mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	@@ -868,6 +868,8 @@ ACCOUNT_LOGIN_ATTEMPTS_LIMIT = get_setting('INVENTREE_LOGIN_ATTEMPTS', 'login_at
 | 
			
		||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = get_setting('INVENTREE_LOGIN_DEFAULT_HTTP_PROTOCOL', 'login_default_protocol', 'http')
 | 
			
		||||
ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
 | 
			
		||||
ACCOUNT_PREVENT_ENUMERATION = True
 | 
			
		||||
# 2FA
 | 
			
		||||
REMOVE_SUCCESS_URL = 'settings'
 | 
			
		||||
 | 
			
		||||
# override forms / adapters
 | 
			
		||||
ACCOUNT_FORMS = {
 | 
			
		||||
 
 | 
			
		||||
@@ -38,9 +38,9 @@ from .views import (AboutView, AppearanceSelectView, CustomConnectionsView,
 | 
			
		||||
                    CustomEmailView, CustomLoginView,
 | 
			
		||||
                    CustomPasswordResetFromKeyView,
 | 
			
		||||
                    CustomSessionDeleteOtherView, CustomSessionDeleteView,
 | 
			
		||||
                    CustomTwoFactorRemove, DatabaseStatsView, DynamicJsView,
 | 
			
		||||
                    EditUserView, IndexView, NotificationsView, SearchView,
 | 
			
		||||
                    SetPasswordView, SettingsView, auth_request)
 | 
			
		||||
                    DatabaseStatsView, DynamicJsView, EditUserView, IndexView,
 | 
			
		||||
                    NotificationsView, SearchView, SetPasswordView,
 | 
			
		||||
                    SettingsView, auth_request)
 | 
			
		||||
 | 
			
		||||
admin.site.site_header = "InvenTree Admin"
 | 
			
		||||
 | 
			
		||||
@@ -191,10 +191,6 @@ frontendpatterns = [
 | 
			
		||||
    re_path(r'^accounts/social/connections/', CustomConnectionsView.as_view(), name='socialaccount_connections'),
 | 
			
		||||
    re_path(r"^accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$", CustomPasswordResetFromKeyView.as_view(), name="account_reset_password_from_key"),
 | 
			
		||||
 | 
			
		||||
    # Temporary fix for django-allauth-2fa # TODO remove
 | 
			
		||||
    # See https://github.com/inventree/InvenTree/security/advisories/GHSA-8j76-mm54-52xq
 | 
			
		||||
    re_path(r'^accounts/two_factor/remove/?$', CustomTwoFactorRemove.as_view(), name='two-factor-remove'),
 | 
			
		||||
 | 
			
		||||
    # Override login page
 | 
			
		||||
    re_path("accounts/login/", CustomLoginView.as_view(), name="account_login"),
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,6 @@ from allauth.account.views import (EmailView, LoginView,
 | 
			
		||||
                                   PasswordResetFromKeyView)
 | 
			
		||||
from allauth.socialaccount.forms import DisconnectForm
 | 
			
		||||
from allauth.socialaccount.views import ConnectionsView
 | 
			
		||||
from allauth_2fa.views import TwoFactorRemove
 | 
			
		||||
from djmoney.contrib.exchange.models import ExchangeBackend, Rate
 | 
			
		||||
from user_sessions.views import SessionDeleteOtherView, SessionDeleteView
 | 
			
		||||
 | 
			
		||||
@@ -664,9 +663,3 @@ class NotificationsView(TemplateView):
 | 
			
		||||
    """View for showing notifications."""
 | 
			
		||||
 | 
			
		||||
    template_name = "InvenTree/notifications/notifications.html"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Custom 2FA removal form to allow custom redirect URL
 | 
			
		||||
class CustomTwoFactorRemove(TwoFactorRemove):
 | 
			
		||||
    """Specify custom URL redirect."""
 | 
			
		||||
    success_url = reverse_lazy("settings")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user