71 new_params['sidebar_grouping'] = 'Clubs' |
71 new_params['sidebar_grouping'] = 'Clubs' |
72 |
72 |
73 new_params['create_template'] = 'soc/models/twoline_edit.html' |
73 new_params['create_template'] = 'soc/models/twoline_edit.html' |
74 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
74 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
75 |
75 |
76 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status', |
76 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'state', |
77 'created_on', 'last_modified_on'] |
77 'created_on', 'last_modified_on'] |
78 new_params['create_extra_dynafields'] = { |
78 new_params['create_extra_dynafields'] = { |
79 'backup_admin_link_id': forms.CharField( |
79 'backup_admin_link_id': forms.CharField( |
80 label=soc.models.club_app.ClubApplication.backup_admin.verbose_name |
80 label=soc.models.club_app.ClubApplication.backup_admin.verbose_name |
81 ), |
81 ), |
82 'clean_backup_admin_link_id': |
82 'clean_backup_admin_link_id': |
83 cleaning.clean_users_not_same('backup_admin_link_id'), |
83 cleaning.clean_users_not_same('backup_admin_link_id'), |
84 } |
84 } |
85 |
85 |
|
86 new_params['edit_extra_dynafields'] = { |
|
87 'clean_link_id' : cleaning.clean_link_id('link_id'), |
|
88 } |
|
89 |
86 patterns = [(r'^%(url_name)s/(?P<access_type>review)$', |
90 patterns = [(r'^%(url_name)s/(?P<access_type>review)$', |
87 'soc.views.models.%(module_name)s.review_overview', |
91 'soc.views.models.%(module_name)s.review_overview', |
88 'Review %(name_plural)s'), |
92 'Review %(name_plural)s'), |
89 (r'^%(url_name)s/(?P<access_type>review)/%(lnp)s$', |
93 (r'^%(url_name)s/(?P<access_type>review)/%(lnp)s$', |
90 'soc.views.models.%(module_name)s.review', |
94 'soc.views.models.%(module_name)s.review', |
144 request, pa_params, filter, 0) |
148 request, pa_params, filter, 0) |
145 |
149 |
146 # get all the reviewed applications now |
150 # get all the reviewed applications now |
147 |
151 |
148 # re-use the old filter, but set to only reviewed and accepted |
152 # re-use the old filter, but set to only reviewed and accepted |
149 filter['status'] = 'accepted' |
153 filter['state'] = 'accepted' |
150 |
154 |
151 aa_params = params.copy() # accepted applications |
155 aa_params = params.copy() # accepted applications |
152 |
156 |
153 if is_developer: |
157 if is_developer: |
154 aa_params['list_description'] = ugettext( |
158 aa_params['list_description'] = ugettext( |
164 request, aa_params, filter, 1) |
168 request, aa_params, filter, 1) |
165 |
169 |
166 # get all the reviewed applications that were denied |
170 # get all the reviewed applications that were denied |
167 |
171 |
168 # re use the old filter, but this time only for denied apps |
172 # re use the old filter, but this time only for denied apps |
169 filter['status'] = 'rejected' |
173 filter['state'] = 'rejected' |
170 |
174 |
171 da_params = params.copy() # denied applications |
175 da_params = params.copy() # denied applications |
172 |
176 |
173 if is_developer: |
177 if is_developer: |
174 da_params['list_description'] = ugettext( |
178 da_params['list_description'] = ugettext( |
252 error, request, template=params['error_public'], context=context) |
256 error, request, template=params['error_public'], context=context) |
253 |
257 |
254 get_dict = request.GET |
258 get_dict = request.GET |
255 |
259 |
256 # check to see if we can make a decision for this application |
260 # check to see if we can make a decision for this application |
257 if 'status' in get_dict.keys(): |
261 if 'state' in get_dict.keys(): |
258 status_value = get_dict['status'] |
262 state_value = get_dict['state'] |
259 |
263 |
260 if status_value in ['accepted', 'rejected', 'ignored']: |
264 if state_value in ['accepted', 'rejected', 'ignored']: |
261 # this application has been properly reviewed update the status |
265 # this application has been properly reviewed update the state |
262 fields = {'status' : status_value} |
266 fields = {'state' : state_value} |
263 |
267 |
264 self._logic.updateEntityProperties(entity, fields) |
268 self._logic.updateEntityProperties(entity, fields) |
265 |
269 |
266 if status_value == 'accepted': |
270 if state_value == 'accepted': |
267 # the application has been accepted send out a notification |
271 # the application has been accepted send out a notification |
268 notifications.sendNewClubNotification(entity) |
272 notifications.sendNewClubNotification(entity) |
269 |
273 |
270 return self.reviewOverview(request, access_type, |
274 return self.reviewOverview(request, access_type, |
271 page_name=page_name, params=params, **kwargs) |
275 page_name=page_name, params=params, **kwargs) |
286 """ |
290 """ |
287 |
291 |
288 params = dicts.merge(params, self._params) |
292 params = dicts.merge(params, self._params) |
289 |
293 |
290 # only select the requests that haven't been reviewed yet |
294 # only select the requests that haven't been reviewed yet |
291 filter = {'status' : 'needs review'} |
295 filter = {'state' : 'needs review'} |
292 |
296 |
293 ur_params = params.copy() |
297 ur_params = params.copy() |
294 ur_params['list_description'] = ugettext('A list of all unhandled ' |
298 ur_params['list_description'] = ugettext('A list of all unhandled ' |
295 'applications.') |
299 'applications.') |
296 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
300 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
297 |
301 |
298 ur_list = helper.lists.getListContent( |
302 ur_list = helper.lists.getListContent( |
299 request, ur_params, filter, 0) |
303 request, ur_params, filter, 0) |
300 |
304 |
301 # only select the requests that haven't been turned into a group yet |
305 # only select the requests that haven't been turned into a group yet |
302 filter['status'] = 'accepted' |
306 filter['state'] = 'accepted' |
303 |
307 |
304 uh_params = params.copy() |
308 uh_params = params.copy() |
305 uh_params['list_description'] = ugettext('A list of all applications ' |
309 uh_params['list_description'] = ugettext('A list of all applications ' |
306 'that have been accepted but not turned into a Club yet') |
310 'that have been accepted but not turned into a Club yet') |
307 uh_params ['list_action'] = (redirects.getReviewRedirect, params) |
311 uh_params ['list_action'] = (redirects.getReviewRedirect, params) |
308 |
312 |
309 uh_list = helper.lists.getListContent( |
313 uh_list = helper.lists.getListContent( |
310 request, uh_params, filter, 1) |
314 request, uh_params, filter, 1) |
311 |
315 |
312 # only select the requests the have been rejected |
316 # only select the requests the have been rejected |
313 filter ['status'] = 'rejected' |
317 filter ['state'] = 'rejected' |
314 |
318 |
315 den_params = params.copy() |
319 den_params = params.copy() |
316 den_params['list_description'] = ugettext('A list of all applications ' |
320 den_params['list_description'] = ugettext('A list of all applications ' |
317 'that have been rejected') |
321 'that have been rejected') |
318 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
322 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
319 |
323 |
320 den_list = helper.lists.getListContent( |
324 den_list = helper.lists.getListContent( |
321 request, den_params, filter, 2) |
325 request, den_params, filter, 2) |
322 |
326 |
323 # only select the request that have been ignored |
327 # only select the request that have been ignored |
324 filter ['status'] = 'ignored' |
328 filter ['state'] = 'ignored' |
325 |
329 |
326 ign_params = params.copy() |
330 ign_params = params.copy() |
327 ign_params['list_description'] = ugettext('A list of all applications ' |
331 ign_params['list_description'] = ugettext('A list of all applications ' |
328 'that have been ignored') |
332 'that have been ignored') |
329 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |
333 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |