Commit 0b6a802d83a3b709d2003ea7f9efcbfbec7858a7

Authored by Felipe Henrique de Almeida Bormann
2 parents 2c7c7fd0 3bef809f

fixed categories views conflict

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
categories/views.py
@@ -28,15 +28,16 @@ class IndexView(views.SuperuserRequiredMixin, LoginRequiredMixin, ListView): @@ -28,15 +28,16 @@ class IndexView(views.SuperuserRequiredMixin, LoginRequiredMixin, ListView):
28 28
29 login_url = reverse_lazy("users:login") 29 login_url = reverse_lazy("users:login")
30 redirect_field_name = 'next' 30 redirect_field_name = 'next'
31 - queryset = Category.objects.all().order_by('name') 31 + model = Category
  32 +
32 template_name = 'categories/list.html' 33 template_name = 'categories/list.html'
33 context_object_name = 'categories' 34 context_object_name = 'categories'
34 paginate_by = 10 35 paginate_by = 10
35 36
36 def get_queryset(self): 37 def get_queryset(self):
37 - result = super(IndexView, self).get_queryset() 38 + categories = Category.objects.all().order_by('name')
38 39
39 - return result 40 + return categories
40 41
41 def render_to_response(self, context, **response_kwargs): 42 def render_to_response(self, context, **response_kwargs):
42 if self.request.user.is_staff: 43 if self.request.user.is_staff: