From 1804cd882804c8bed953af19db86aeb738836c43 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 5 Oct 2012 22:14:12 -0400 Subject: [PATCH] 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 35571e184f08912dca10ba9c2f7ef7d629afabdd. --- apps/common/__init__.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/common/__init__.py b/apps/common/__init__.py index de85ce4b66..915dc928eb 100644 --- a/apps/common/__init__.py +++ b/apps/common/__init__.py @@ -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):