Commit 84de9b89b9fed6d9c017ba5ae3e3de39ee82a2b7
1 parent
86c2739f
Exists in
master
and in
5 other branches
Added context processor to Notifications #41
Showing
3 changed files
with
8 additions
and
4 deletions
Show diff stats
amadeus/settings.py
@@ -77,6 +77,8 @@ TEMPLATES = [ | @@ -77,6 +77,8 @@ TEMPLATES = [ | ||
77 | 'django.template.context_processors.request', | 77 | 'django.template.context_processors.request', |
78 | 'django.contrib.auth.context_processors.auth', | 78 | 'django.contrib.auth.context_processors.auth', |
79 | 'django.contrib.messages.context_processors.messages', | 79 | 'django.contrib.messages.context_processors.messages', |
80 | + | ||
81 | + 'core.context_processors.notifications', | ||
80 | ], | 82 | ], |
81 | }, | 83 | }, |
82 | }, | 84 | }, |
app/views.py
@@ -39,10 +39,6 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): | @@ -39,10 +39,6 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): | ||
39 | self.template_name = "home_admin_content.html" | 39 | self.template_name = "home_admin_content.html" |
40 | 40 | ||
41 | super(AppIndex, self).createNotification("teste", not_resource="home", resource_link="/register") | 41 | super(AppIndex, self).createNotification("teste", not_resource="home", resource_link="/register") |
42 | - | ||
43 | - notifications = Notification.objects.filter(user= self.request.user, read=False) | ||
44 | - context['notifications'] = notifications | ||
45 | - | ||
46 | return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) | 42 | return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) |
47 | 43 | ||
48 | 44 |