app/soc/logic/site/id_user.py
changeset 141 e120c24b89e2
parent 138 e1167bdf71a4
child 164 afdf502c6cc4
--- a/app/soc/logic/site/id_user.py	Sat Sep 13 21:27:17 2008 +0000
+++ b/app/soc/logic/site/id_user.py	Sat Sep 13 22:00:51 2008 +0000
@@ -134,7 +134,27 @@
     return True
   else:
     return False
+    
+def isIdUser(id=None):
+  """Returns True if Google Account has it's soc.models.user.User entity in datastore.
 
+  Args:
+    id: a Google Account (users.User) object; if id is not supplied,
+      the current logged-in user is checked
+  """
+  id = getIdIfMissing(id)
+
+  if not id:
+    # no Google Account was supplied or is logged in
+    return False
+
+  user = getUserFromId(id)
+
+  if not user:
+    # no User entity for this Google Account
+    return False
+  
+  return True
 
 def isIdDeveloper(id=None):
   """Returns True if Google Account is a Developer with special privileges.