Fix the user editing
authorSverre Rabbelier <srabbelier@gmail.com>
Tue, 24 Feb 2009 12:52:19 +0000
changeset 1479 bc738f92a4d8
parent 1478 2cf71cd69521
child 1480 d2d9087d712f
Fix the user editing Noticed by: Lennard de Rijk Patch by: Sverre Rabbelier
app/soc/logic/models/user.py
--- a/app/soc/logic/models/user.py	Mon Feb 23 21:01:33 2009 +0000
+++ b/app/soc/logic/models/user.py	Tue Feb 24 12:52:19 2009 +0000
@@ -154,8 +154,16 @@
     if (name == 'agreed_to_tos') and (entity.agreed_to_tos != value):
       sidebar.flush(entity.account)
 
-    if (name == 'account') and (str(entity.account) != str(value)):
-      entity.former_accounts.append(entity.account)
+    if (name == 'account'):
+      if (str(entity.account) != str(value)):
+        entity.former_accounts.append(entity.account)
+      elif entity.account != value:
+        # this occurs when the account ends in the auth domain, e.g.:
+        # if the auth domain is "example.com", then the following would
+        # would put us here:
+        # entity.account = users.User('foo@example.com')
+        # value = 'foo'
+        return False
 
     return True