From cc040bc09fb259b1027b31fe1b257edf2743fa05 Mon Sep 17 00:00:00 2001 From: xiez Date: Thu, 9 Aug 2012 00:06:04 +0800 Subject: [PATCH] Fix circular import bug --- base/accounts.py | 3 +-- thirdpart/registration/models.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/base/accounts.py b/base/accounts.py index c8d2301b3e..4489ea0eb0 100644 --- a/base/accounts.py +++ b/base/accounts.py @@ -11,7 +11,6 @@ from auth.models import get_hexdigest, check_password from auth import authenticate, login from registration import signals #from registration.forms import RegistrationForm -from registration.models import RegistrationProfile from seaserv import ccnet_threaded_rpc class UserManager(object): @@ -206,7 +205,7 @@ class RegistrationBackend(object): else: site = RequestSite(request) - + from registration.models import RegistrationProfile if settings.ACTIVATE_AFTER_REGISTRATION == True: # since user will be activated after registration, # so we will not use email sending, just create acitvated user diff --git a/thirdpart/registration/models.py b/thirdpart/registration/models.py index 94925eb5f4..be296af058 100644 --- a/thirdpart/registration/models.py +++ b/thirdpart/registration/models.py @@ -10,6 +10,8 @@ from django.template.loader import render_to_string from django.utils.hashcompat import sha_constructor from django.utils.translation import ugettext_lazy as _ +from seahub.base.accounts import User + SHA1_RE = re.compile('^[a-f0-9]{40}$') @@ -289,5 +291,3 @@ class RegistrationProfile(models.Model): except User.DoesNotExist: pass -# We put this import here to prevent circular import -from seahub.base.accounts import User