checkIsHostForProgram fixes: logic argument has default value and is actually used to look up for a program entity,
authorDaniel Hans <Daniel.M.Hans@gmail.com>
Fri, 30 Oct 2009 12:40:56 +0100
changeset 3068 1e01ffe9cc61
parent 3067 371e1979ee6a
child 3069 1b9c554ca96d
checkIsHostForProgram fixes: logic argument has default value and is actually used to look up for a program entity,
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Fri Oct 30 01:23:37 2009 +0100
+++ b/app/soc/views/helper/access.py	Fri Oct 30 12:40:56 2009 +0100
@@ -983,19 +983,15 @@
 
   @allowDeveloper
   @denySidebar
-  def checkIsHostForProgram(self, django_args, logic):
+  def checkIsHostForProgram(self, django_args, logic=program_logic):
     """Checks if the user is a host for the specified program.
 
     Args:
       django_args: a dictionary with django's arguments
-      logic: the logic used to look up for program entity; if not specified
-        standard program_logic will be used      
+      logic: the logic used to look up for program entity
     """
 
-    if not logic:
-      logic = program_logic
-
-    program = program_logic.getFromKeyFields(django_args)
+    program = logic.getFromKeyFields(django_args)
 
     if not program or program.status == 'invalid':
       raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_PROGRAM_MSG)