app/soc/logic/accounts.py
changeset 1520 ac407f5b10dc
parent 1519 eb70b27696de
child 1527 0071733da7cd
equal deleted inserted replaced
1519:eb70b27696de 1520:ac407f5b10dc
    27 
    27 
    28 from soc.logic import models
    28 from soc.logic import models
    29 
    29 
    30 import soc.logic.models.user
    30 import soc.logic.models.user
    31 
    31 
       
    32 
       
    33 def normalizeAccount(account):
       
    34   """Returns a normalized version of the specified account.
       
    35   """
       
    36 
       
    37   normalized = str(account).lower()
       
    38 
       
    39   if account.email() == normalized:
       
    40     return account
       
    41 
       
    42   return users.User(email=normalized)
    32 
    43 
    33 def isDeveloper(account=None, user=None):
    44 def isDeveloper(account=None, user=None):
    34   """Returns True if a Google Account is a Developer with special privileges.
    45   """Returns True if a Google Account is a Developer with special privileges.
    35   
    46   
    36   Since it only works on the current logged-in user, if account matches the
    47   Since it only works on the current logged-in user, if account matches the