Fixed 'Register as a student' link problem for GHOP program.
authorDaniel Hans <Daniel.M.Hans@gmail.com>
Wed, 04 Nov 2009 21:37:44 +0100
changeset 3079 c491d96dce2c
parent 3078 bd001e9ab9d4
child 3080 30a33926ab91
Fixed 'Register as a student' link problem for GHOP program. Params and new_params in student view are also sub-merged now, so the apply pattern may be used by GHOP student view.
app/soc/modules/ghop/views/models/student.py
app/soc/views/models/student.py
--- a/app/soc/modules/ghop/views/models/student.py	Tue Nov 03 17:07:10 2009 +0100
+++ b/app/soc/modules/ghop/views/models/student.py	Wed Nov 04 21:37:44 2009 +0100
@@ -72,10 +72,11 @@
     rights['edit'] = [('checkIsMyActiveRole', ghop_student_logic.logic)]
     rights['apply'] = [
         'checkIsUser',
-        ('checkIsActivePeriod', ['student_signup', 'scope_path']),
+        ('checkIsActivePeriod', ['student_signup', 'scope_path',
+            ghop_program_logic.logic]),
         ('checkIsNotParticipatingInProgramInScope',
-        [ghop_student_logic.logic, ghop_org_admin_logic.logic,
-        ghop_mentor_logic.logic]),
+            [ghop_program_logic.logic, ghop_student_logic.logic,
+            ghop_org_admin_logic.logic, ghop_mentor_logic.logic]),
         'checkCanApply']
     rights['manage'] = [('checkIsMyActiveRole', ghop_student_logic.logic)]
     rights['list_student_tasks'] = [('checkHasActiveRoleForScope',
@@ -163,6 +164,7 @@
 
     return result
 
+
 view = View()
 
 apply = decorators.view(view.apply)
--- a/app/soc/views/models/student.py	Tue Nov 03 17:07:10 2009 +0100
+++ b/app/soc/views/models/student.py	Wed Nov 04 21:37:44 2009 +0100
@@ -147,7 +147,7 @@
 
     new_params['show_in_roles_overview'] = True
 
-    params = dicts.merge(params, new_params)
+    params = dicts.merge(params, new_params, sub_merge=True)
 
     super(View, self).__init__(params=params)