Make use of default value
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 21 Feb 2009 20:14:19 +0000
changeset 1441 e633906ed88d
parent 1440 58ac0b3f59ac
child 1442 8eec34007e80
Make use of default value field_name is not modified and as such it is possible to properly use the default value system (rather than just specifying None). Patch by: Sverre Rabbelier
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Sat Feb 21 20:13:46 2009 +0000
+++ b/app/soc/views/helper/access.py	Sat Feb 21 20:14:19 2009 +0000
@@ -625,13 +625,11 @@
 
     raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_ENTITY_MSG)
 
-  def checkHasActiveRoleForScope(self, django_args, logic, field_name=None):
+  def checkHasActiveRoleForScope(self, django_args, logic,
+                                 field_name='scope_path'):
     """Checks that the user has the specified active role.
     """
 
-    if not field_name:
-      field_name = 'scope_path'
-
     django_args['user'] = self.user
     self.checkIsActive(django_args, logic, field_name, 'user')