Commit b1e465bc469ac6fa71837c66743616186fe8fb8c
1 parent
4c1de57d
Exists in
master
and in
5 other branches
Handling non-admin access [Issue: #45]
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/views.py
... | ... | @@ -32,11 +32,17 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): |
32 | 32 | def render_to_response(self, context, **response_kwargs): |
33 | 33 | if self.request.user.is_staff: |
34 | 34 | context['page_template'] = "home_admin_content.html" |
35 | + else: | |
36 | + context['page_template'] = "home_teacher_student_content.html" | |
35 | 37 | |
36 | 38 | context['title'] = 'Amadeus' |
37 | 39 | |
38 | 40 | if self.request.is_ajax(): |
39 | - self.template_name = "home_admin_content.html" | |
41 | + if self.request.user.is_staff: | |
42 | + self.template_name = "home_admin_content.html" | |
43 | + else: | |
44 | + self.template_name = "home_teacher_student_content.html" | |
45 | + | |
40 | 46 | |
41 | 47 | super(AppIndex, self).createNotification("teste", not_resource="home", resource_link="/register") |
42 | 48 | ... | ... |