# HG changeset patch # User Madhusudan.C.S # Date 1250202520 -19800 # Node ID eb654b51053bb6956239728c540f6cc308351f04 # Parent 71a5a56cf29ea3f9aea2e5f4ad0625023d9160cb checkIsAfterEvent takes logic as argument instead of hard coded program logic. checkIsAfterEvent access checker uses hard coded core program_logic. Instead it now takes the program logic as an argument to accommodate GHOPProgram logic. diff -r 71a5a56cf29e -r eb654b51053b app/soc/views/helper/access.py --- a/app/soc/views/helper/access.py Thu Aug 13 14:02:22 2009 -0700 +++ b/app/soc/views/helper/access.py Fri Aug 14 03:58:40 2009 +0530 @@ -1016,7 +1016,8 @@ @allowDeveloper @denySidebar - def checkIsAfterEvent(self, django_args, event_name, key_name_arg): + def checkIsAfterEvent(self, django_args, event_name, + key_name_arg, program_logic): """Checks if the given event has taken place for the given program. Args: @@ -1025,6 +1026,7 @@ key_name_arg: the entry in django_args that specifies the given program keyname. If none is given the key_name is constructed from django_args itself. + program_logic: Program Logic instance Raises: AccessViolationResponse: diff -r 71a5a56cf29e -r eb654b51053b app/soc/views/models/program.py --- a/app/soc/views/models/program.py Thu Aug 13 14:02:22 2009 -0700 +++ b/app/soc/views/models/program.py Fri Aug 14 03:58:40 2009 +0530 @@ -99,9 +99,11 @@ rights['show_duplicates'] = ['checkIsHostForProgram'] rights['assigned_proposals'] = ['checkIsHostForProgram'] rights['accepted_orgs'] = [('checkIsAfterEvent', - ['accepted_organization_announced_deadline', '__all__'])] + ['accepted_organization_announced_deadline', + '__all__', program_logic.logic])] rights['list_projects'] = [('checkIsAfterEvent', - ['accepted_students_announced_deadline', '__all__'])] + ['accepted_students_announced_deadline', + '__all__', program_logic.logic])] new_params = {} new_params['logic'] = soc.logic.models.program.logic diff -r 71a5a56cf29e -r eb654b51053b app/soc/views/models/student.py --- a/app/soc/views/models/student.py Thu Aug 13 14:02:22 2009 -0700 +++ b/app/soc/views/models/student.py Fri Aug 14 03:58:40 2009 +0530 @@ -73,7 +73,7 @@ rights['list_projects'] = [ ('checkHasActiveRoleForScope', student_logic.logic), ('checkIsAfterEvent', ['accepted_students_announced_deadline', - 'scope_path'])] + 'scope_path', program_logic.logic])] new_params = {} new_params['logic'] = soc.logic.models.student.logic