diff -r b56976cac36b -r 0aa3de1b2acc app/soc/logic/accounts.py --- a/app/soc/logic/accounts.py Tue Mar 03 03:37:16 2009 +0000 +++ b/app/soc/logic/accounts.py Tue Mar 03 19:27:55 2009 +0000 @@ -27,6 +27,14 @@ from google.appengine.api import users +def getCurrentAccount(normalize=True): + """Returns an optionally normalized version of the current account. + """ + + account = users.get_current_user() + return normalizeAccount(account) if (account and normalize) else account + + def normalizeAccount(account): """Returns a normalized version of the specified account. """ @@ -68,7 +76,7 @@ """ # Get the currently logged in user - current = users.get_current_user() + current = getCurrentAccount() if current and (not account): # default to the current user