app/soc/logic/accounts.py
changeset 724 b26295df0d9a
parent 592 be98a2f5d8a2
child 749 134d9954f4dc
--- a/app/soc/logic/accounts.py	Fri Dec 12 00:35:08 2008 +0000
+++ b/app/soc/logic/accounts.py	Fri Dec 12 00:35:28 2008 +0000
@@ -31,7 +31,7 @@
 import soc.logic.models.user
 
 
-def isDeveloper(account=None):
+def isDeveloper(account=None, user=None):
   """Returns True if a Google Account is a Developer with special privileges.
   
   Since it only works on the current logged-in user, if account matches the
@@ -48,6 +48,9 @@
       the current logged-in user is checked
   """
 
+  if user and (not account):
+    account = user.account
+
   # Get the currently logged in user
   current = users.get_current_user()
 
@@ -65,7 +68,8 @@
   if not account:
     account = current
 
-  user = models.user.logic.getForFields({'account': account}, unique=True)
+  if not user:
+    user = models.user.logic.getForFields({'account': account}, unique=True)
 
   if not user:
     # no User entity for this Google Account, and account is not the