Remove autoadmin code and move it to the external django-autoadmin package

This commit is contained in:
Roberto Rosario
2015-06-14 03:51:36 -04:00
parent f3beb3b5e7
commit 37b4f42afe
10 changed files with 44 additions and 103 deletions

View File

@@ -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)