app/soc/logic/accounts.py
changeset 1547 c8c269ef0498
parent 1527 0071733da7cd
child 1600 0aa3de1b2acc
--- a/app/soc/logic/accounts.py	Fri Feb 27 23:33:20 2009 +0000
+++ b/app/soc/logic/accounts.py	Sat Feb 28 00:09:34 2009 +0000
@@ -38,6 +38,19 @@
 
   return users.User(email=normalized)
 
+def denormalizeAccount(account):
+  """Returns a denormalized version of the specified account.
+  """
+
+  if account.email().find('@') != -1:
+    return account
+
+  normalized = normalizeAccount(account)
+  domain = account.auth_domain()
+  denormalized = ''.join([account.email(), '@', domain])
+
+  return users.User(email=denormalized)
+
 def isDeveloper(account=None):
   """Returns True if a Google Account is a Developer with special privileges.