app/soc/views/helper/access.py
changeset 2610 95949d4c45d9
parent 2583 3a8275049403
child 2660 e2654d53a643
--- a/app/soc/views/helper/access.py	Sun Jul 12 13:55:21 2009 +0200
+++ b/app/soc/views/helper/access.py	Sun Jul 12 14:03:35 2009 +0200
@@ -939,7 +939,7 @@
   @denySidebar
   def checkIsHostForProgram(self, django_args):
     """Checks if the user is a host for the specified program.
-    
+
     Args:
       django_args: a dictionary with django's arguments
     """
@@ -956,12 +956,17 @@
   @denySidebar
   def checkIsHostForProgramInScope(self, django_args):
     """Checks if the user is a host for the specified program.
-    
+
     Args:
       django_args: a dictionary with django's arguments
     """
 
-    program = program_logic.getFromKeyName(django_args['scope_path'])
+    scope_path = django_args.get('scope_path')
+
+    if not scope_path:
+      raise out_of_band.AccessViolation(message_fmt=DEF_PAGE_DENIED_MSG)
+
+    program = program_logic.getFromKeyName(scope_path)
 
     if not program or program.status == 'invalid':
       raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_PROGRAM_MSG)