Changed access.py to comply more with the style of the module.
authorLennard de Rijk <ljvderijk@gmail.com>
Wed, 28 Jan 2009 17:33:05 +0000
changeset 1048 0fe0cb8f7253
parent 1047 26fade94886b
child 1049 cc6aedbde28d
Changed access.py to comply more with the style of the module.
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Wed Jan 28 17:31:02 2009 +0000
+++ b/app/soc/views/helper/access.py	Wed Jan 28 17:33:05 2009 +0000
@@ -358,12 +358,14 @@
 
     self.checkIsLoggedIn(django_args)
 
-    if self.user or user_logic.isFormerAccount(self.id):
-      message_fmt = DEF_USER_ACCOUNT_INVALID_MSG_FMT % {
-          'email' : self.id.email()}
-      raise out_of_band.LoginRequest(message_fmt=message_fmt)
+    if not self.user and not user_logic.isFormerAccount(self.id):
+      # this account has not been used yet
+      return
 
-    return
+    message_fmt = DEF_USER_ACCOUNT_INVALID_MSG_FMT % {
+        'email' : self.id.email()}
+    raise out_of_band.LoginRequest(message_fmt=message_fmt)
+
 
   def checkHasUserEntity(self, django_args):
     """Raises an alternate HTTP response if Google Account has no User entity.