33 from soc.logic.models import user as user_logic |
33 from soc.logic.models import user as user_logic |
34 from soc.models import group_app as group_app_model |
34 from soc.models import group_app as group_app_model |
35 from soc.views import helper |
35 from soc.views import helper |
36 from soc.views import out_of_band |
36 from soc.views import out_of_band |
37 from soc.views.helper import access |
37 from soc.views.helper import access |
|
38 from soc.views.helper import decorators |
38 from soc.views.helper import redirects |
39 from soc.views.helper import redirects |
39 from soc.views.helper import lists as list_helper |
40 from soc.views.helper import lists as list_helper |
40 from soc.views.models import group_app |
41 from soc.views.models import group_app |
41 |
42 |
42 import soc.logic.dicts |
43 import soc.logic.dicts |
100 |
101 |
101 params = dicts.merge(params, new_params) |
102 params = dicts.merge(params, new_params) |
102 |
103 |
103 super(View, self).__init__(params=params) |
104 super(View, self).__init__(params=params) |
104 |
105 |
|
106 @decorators.merge_params |
|
107 @decorators.check_access |
105 def list(self, request, access_type, |
108 def list(self, request, access_type, |
106 page_name=None, params=None, filter=None): |
109 page_name=None, params=None, filter=None): |
107 """Lists all notifications that the current logged in user has stored. |
110 """Lists all notifications that the current logged in user has stored. |
108 |
111 |
109 for parameters see base.list() |
112 for parameters see base.list() |
110 """ |
113 """ |
111 |
|
112 params = dicts.merge(params, self._params) |
|
113 |
|
114 try: |
|
115 access.checkAccess(access_type, request, params['rights']) |
|
116 except out_of_band.Error, error: |
|
117 return helper.responses.errorResponse(error, request) |
|
118 |
114 |
119 # get the current user |
115 # get the current user |
120 user_entity = user_logic.logic.getForCurrentAccount() |
116 user_entity = user_logic.logic.getForCurrentAccount() |
121 |
117 |
122 is_developer = accounts.isDeveloper(user=user_entity) |
118 is_developer = accounts.isDeveloper(user=user_entity) |
212 """See base._public(). |
208 """See base._public(). |
213 """ |
209 """ |
214 |
210 |
215 context['entity_type_url'] = self._params['url_name'] |
211 context['entity_type_url'] = self._params['url_name'] |
216 |
212 |
|
213 @decorators.merge_params |
|
214 @decorators.check_access |
217 def review(self, request, access_type, |
215 def review(self, request, access_type, |
218 page_name=None, params=None, **kwargs): |
216 page_name=None, params=None, **kwargs): |
219 """Handles the view containing the review of an application. |
217 """Handles the view containing the review of an application. |
220 |
218 |
221 accepted (true or false) in the GET data will mark |
219 accepted (true or false) in the GET data will mark |
222 the application accordingly. |
220 the application accordingly. |
223 |
221 |
224 |
222 |
225 For params see base.View.public(). |
223 For params see base.View.public(). |
226 """ |
224 """ |
227 |
|
228 params = dicts.merge(params, self._params) |
|
229 |
|
230 try: |
|
231 access.checkAccess(access_type, request, rights=params['rights']) |
|
232 except out_of_band.Error, error: |
|
233 return helper.responses.errorResponse(error, request) |
|
234 |
225 |
235 # create default template context for use with any templates |
226 # create default template context for use with any templates |
236 context = helper.responses.getUniversalContext(request) |
227 context = helper.responses.getUniversalContext(request) |
237 context['page_name'] = page_name |
228 context['page_name'] = page_name |
238 entity = None |
229 entity = None |
276 params['public_template'] = params['review_template'] |
267 params['public_template'] = params['review_template'] |
277 |
268 |
278 return super(View, self).public(request, access_type, |
269 return super(View, self).public(request, access_type, |
279 page_name=page_name, params=params, **kwargs) |
270 page_name=page_name, params=params, **kwargs) |
280 |
271 |
|
272 @decorators.merge_params |
|
273 @decorators.check_access |
281 def reviewOverview(self, request, access_type, |
274 def reviewOverview(self, request, access_type, |
282 page_name=None, params=None, **kwargs): |
275 page_name=None, params=None, **kwargs): |
283 """Displays multiple lists of applications that are in different |
276 """Displays multiple lists of applications that are in different |
284 states of the application process. |
277 states of the application process. |
285 """ |
278 """ |