Remove autoadmin code and move it to the external django-autoadmin package
This commit is contained in:
@@ -3,20 +3,10 @@ from __future__ import unicode_literals
|
||||
from django.conf import settings
|
||||
|
||||
from .models import (
|
||||
AnonymousUserSingleton, AutoAdminSingleton, UserLocaleProfile
|
||||
AnonymousUserSingleton, UserLocaleProfile
|
||||
)
|
||||
|
||||
|
||||
def auto_admin_account_passwd_change(sender, instance, **kwargs):
|
||||
auto_admin_properties = AutoAdminSingleton.objects.get()
|
||||
if instance == auto_admin_properties.account and instance.password != auto_admin_properties.password_hash:
|
||||
# Only delete the auto admin properties when the password has been changed
|
||||
auto_admin_properties.account = None
|
||||
auto_admin_properties.password = None
|
||||
auto_admin_properties.password_hash = None
|
||||
auto_admin_properties.save()
|
||||
|
||||
|
||||
def user_locale_profile_session_config(sender, request, user, **kwargs):
|
||||
if hasattr(request, 'session'):
|
||||
user_locale_profile, created = UserLocaleProfile.objects.get_or_create(user=user)
|
||||
|
||||
Reference in New Issue
Block a user