app/soc/views/helper/access.py
changeset 890 b3bf833c4580
parent 889 5f3136a5eb4c
child 891 3d40190f35b6
--- a/app/soc/views/helper/access.py	Wed Jan 21 21:32:51 2009 +0000
+++ b/app/soc/views/helper/access.py	Wed Jan 21 21:41:36 2009 +0000
@@ -236,20 +236,21 @@
 
 
 def checkIsHost(request, args, kwargs):
-  """Returns an alternate HTTP response if Google Account has no Host entity
+  """Raises an alternate HTTP response if Google Account has no Host entity
      for the specified program.
 
   Args:
     request: a Django HTTP request
 
-   Raises:
-     AccessViolationResponse: if the required authorization is not met
-
-  Returns:
-    None if Host exists for the specified program, or a subclass of
-    django.http.HttpResponse which contains the alternate response
-    should be returned by the calling view.
+  Raises:
+    AccessViolationResponse:
+    * if User has not been invited to be a Host, or
+    * if User is not already a Host, or
+    * if User has not agreed to the site-wide ToS, or
+    * if no User exists for the logged-in Google Account, or
+    * if the user is not even logged in
   """
+  checkAgreesToSiteToS(request, args, kwargs)
 
   try:
     # if the current user is invited to create a host profile we allow access
@@ -258,8 +259,6 @@
   except out_of_band.Error:
     pass
 
-  checkAgreesToSiteToS(request, args, kwargs)
-
   user = user_logic.getForFields({'account': users.get_current_user()},
                                  unique=True)