72 new_params['sidebar_grouping'] = 'Clubs' |
72 new_params['sidebar_grouping'] = 'Clubs' |
73 |
73 |
74 new_params['create_template'] = 'soc/models/twoline_edit.html' |
74 new_params['create_template'] = 'soc/models/twoline_edit.html' |
75 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
75 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
76 |
76 |
77 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'state', |
77 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status', |
78 'created_on', 'last_modified_on'] |
78 'created_on', 'last_modified_on'] |
79 new_params['create_extra_dynafields'] = { |
79 new_params['create_extra_dynafields'] = { |
80 'backup_admin_link_id': forms.CharField( |
80 'backup_admin_link_id': forms.CharField( |
81 label=soc.models.club_app.ClubApplication.backup_admin.verbose_name |
81 label=soc.models.club_app.ClubApplication.backup_admin.verbose_name |
82 ), |
82 ), |
259 error, request, template=params['error_public'], context=context) |
259 error, request, template=params['error_public'], context=context) |
260 |
260 |
261 get_dict = request.GET |
261 get_dict = request.GET |
262 |
262 |
263 # check to see if we can make a decision for this application |
263 # check to see if we can make a decision for this application |
264 if 'state' in get_dict.keys(): |
264 if 'status' in get_dict.keys(): |
265 state_value = get_dict['state'] |
265 status_value = get_dict['status'] |
266 |
266 |
267 if state_value in ['accepted', 'rejected', 'ignored']: |
267 if status_value in ['accepted', 'rejected', 'ignored']: |
268 # this application has been properly reviewed update the state |
268 # this application has been properly reviewed update the status |
269 fields = {'state' : state_value} |
269 fields = {'status' : status_value} |
270 |
270 |
271 self._logic.updateEntityProperties(entity, fields) |
271 self._logic.updateEntityProperties(entity, fields) |
272 |
272 |
273 if state_value == 'accepted': |
273 if status_value == 'accepted': |
274 # the application has been accepted send out a notification |
274 # the application has been accepted send out a notification |
275 notifications.sendNewClubNotification(entity) |
275 notifications.sendNewClubNotification(entity) |
276 |
276 |
277 return self.reviewOverview(request, access_type, |
277 return self.reviewOverview(request, access_type, |
278 page_name=page_name, params=params, **kwargs) |
278 page_name=page_name, params=params, **kwargs) |
286 |
286 |
287 @decorators.merge_params |
287 @decorators.merge_params |
288 @decorators.check_access |
288 @decorators.check_access |
289 def reviewOverview(self, request, access_type, |
289 def reviewOverview(self, request, access_type, |
290 page_name=None, params=None, **kwargs): |
290 page_name=None, params=None, **kwargs): |
291 """Displays multiple lists of applications that are in different |
291 """Displays multiple lists of applications that are in a different |
292 states of the application process. |
292 status of the application process. |
293 """ |
293 """ |
294 |
294 |
295 params = dicts.merge(params, self._params) |
295 params = dicts.merge(params, self._params) |
296 |
296 |
297 # only select the requests that haven't been reviewed yet |
297 # only select the requests that haven't been reviewed yet |
298 filter = {'state' : 'needs review'} |
298 filter = {'status' : 'needs review'} |
299 |
299 |
300 ur_params = params.copy() |
300 ur_params = params.copy() |
301 ur_params['list_description'] = ugettext('A list of all unhandled ' |
301 ur_params['list_description'] = ugettext('A list of all unhandled ' |
302 'applications.') |
302 'applications.') |
303 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
303 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
304 |
304 |
305 ur_list = helper.lists.getListContent( |
305 ur_list = helper.lists.getListContent( |
306 request, ur_params, filter, 0) |
306 request, ur_params, filter, 0) |
307 |
307 |
308 # only select the requests that haven't been turned into a group yet |
308 # only select the requests that haven't been turned into a group yet |
309 filter['state'] = 'accepted' |
309 filter['status'] = 'accepted' |
310 |
310 |
311 uh_params = params.copy() |
311 uh_params = params.copy() |
312 uh_params['list_description'] = ugettext('A list of all applications ' |
312 uh_params['list_description'] = ugettext('A list of all applications ' |
313 'that have been accepted but not turned into a Club yet') |
313 'that have been accepted but not turned into a Club yet') |
314 uh_params ['list_action'] = (redirects.getReviewRedirect, params) |
314 uh_params ['list_action'] = (redirects.getReviewRedirect, params) |
315 |
315 |
316 uh_list = helper.lists.getListContent( |
316 uh_list = helper.lists.getListContent( |
317 request, uh_params, filter, 1) |
317 request, uh_params, filter, 1) |
318 |
318 |
319 # only select the requests the have been rejected |
319 # only select the requests the have been rejected |
320 filter ['state'] = 'rejected' |
320 filter ['status'] = 'rejected' |
321 |
321 |
322 den_params = params.copy() |
322 den_params = params.copy() |
323 den_params['list_description'] = ugettext('A list of all applications ' |
323 den_params['list_description'] = ugettext('A list of all applications ' |
324 'that have been rejected') |
324 'that have been rejected') |
325 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
325 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
326 |
326 |
327 den_list = helper.lists.getListContent( |
327 den_list = helper.lists.getListContent( |
328 request, den_params, filter, 2) |
328 request, den_params, filter, 2) |
329 |
329 |
330 # only select the request that have been ignored |
330 # only select the request that have been ignored |
331 filter ['state'] = 'ignored' |
331 filter ['status'] = 'ignored' |
332 |
332 |
333 ign_params = params.copy() |
333 ign_params = params.copy() |
334 ign_params['list_description'] = ugettext('A list of all applications ' |
334 ign_params['list_description'] = ugettext('A list of all applications ' |
335 'that have been ignored') |
335 'that have been ignored') |
336 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |
336 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |