equal
deleted
inserted
replaced
21 '"Todd Larsen" <tlarsen@google.com>', |
21 '"Todd Larsen" <tlarsen@google.com>', |
22 ] |
22 ] |
23 |
23 |
24 |
24 |
25 from soc.logic import works |
25 from soc.logic import works |
|
26 from soc.logic.helper import access |
26 from soc.views import simple |
27 from soc.views import simple |
27 from soc.views import helper |
28 from soc.views import helper |
28 import soc.views.helper.lists |
29 import soc.views.helper.lists |
29 import soc.views.helper.responses |
30 import soc.views.helper.responses |
30 |
31 |
43 |
44 |
44 Returns: |
45 Returns: |
45 A subclass of django.http.HttpResponse which either contains the form to |
46 A subclass of django.http.HttpResponse which either contains the form to |
46 be filled out, or a redirect to the correct view in the interface. |
47 be filled out, or a redirect to the correct view in the interface. |
47 """ |
48 """ |
|
49 |
|
50 try: |
|
51 access.checkIsDeveloper(request) |
|
52 except soc.logic.out_of_band.AccessViolationResponse, alt_response: |
|
53 return alt_response.response() |
|
54 |
48 # create default template context for use with any templates |
55 # create default template context for use with any templates |
49 context = helper.responses.getUniversalContext(request) |
56 context = helper.responses.getUniversalContext(request) |
50 |
57 |
51 alt_response = simple.getAltResponseIfNotDeveloper(request, |
|
52 context=context) |
|
53 if alt_response: |
|
54 return alt_response |
|
55 |
|
56 offset, limit = helper.lists.cleanListParameters( |
58 offset, limit = helper.lists.cleanListParameters( |
57 offset=request.GET.get('offset'), limit=request.GET.get('limit')) |
59 offset=request.GET.get('offset'), limit=request.GET.get('limit')) |
58 |
60 |
59 # Fetch one more to see if there should be a 'next' link |
61 # Fetch one more to see if there should be a 'next' link |
60 docs = works.getWorksForLimitAndOffset( |
62 docs = works.getWorksForLimitAndOffset( |