Reverting hotfix patch applied to master branch by accident.
Revert "Catch auto admin creation error attempts when common app has still not been migrated."
This reverts commit 35571e184f.
This commit is contained in:
@@ -10,7 +10,6 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.auth.management import create_superuser
|
||||
from django.dispatch import receiver
|
||||
from django.db.models.signals import post_save
|
||||
from django.db import transaction, DatabaseError
|
||||
|
||||
from navigation.api import register_links, register_top_menu
|
||||
|
||||
@@ -72,14 +71,10 @@ def create_superuser(sender, **kwargs):
|
||||
|
||||
@receiver(post_save, dispatch_uid='auto_admin_account_passwd_change', sender=User)
|
||||
def auto_admin_account_passwd_change(sender, instance, **kwargs):
|
||||
with transaction.commit_on_success():
|
||||
try:
|
||||
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.delete(force=True)
|
||||
except DatabaseError:
|
||||
transaction.rollback()
|
||||
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.delete(force=True)
|
||||
|
||||
|
||||
if (validate_path(TEMPORARY_DIRECTORY) == False) or (not TEMPORARY_DIRECTORY):
|
||||
|
||||
Reference in New Issue
Block a user