Commit a2deb60c772363c3689c85ec8a95296a77c94b38
1 parent
d120c8d2
Exists in
master
and in
3 other branches
improved some code and fixed admin permissions on subjects list
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
categories/views.py
@@ -150,7 +150,7 @@ class DeleteCategory(LogMixin, DeleteView): | @@ -150,7 +150,7 @@ class DeleteCategory(LogMixin, DeleteView): | ||
150 | category = get_object_or_404(Category, slug = self.kwargs.get('slug')) | 150 | category = get_object_or_404(Category, slug = self.kwargs.get('slug')) |
151 | subjects = Subject.objects.filter(category = category) | 151 | subjects = Subject.objects.filter(category = category) |
152 | 152 | ||
153 | - if len(subjects) > 0: | 153 | + if subjects.count() > 0: |
154 | #objeto = category | 154 | #objeto = category |
155 | #messages.success(self.request, _('cannot delete Category "%s" ')%(objeto)) | 155 | #messages.success(self.request, _('cannot delete Category "%s" ')%(objeto)) |
156 | return reverse_lazy('categories:index') | 156 | return reverse_lazy('categories:index') |
subjects/templates/subjects/list.html
@@ -59,14 +59,14 @@ | @@ -59,14 +59,14 @@ | ||
59 | <div class=" divMoreActions"> | 59 | <div class=" divMoreActions"> |
60 | </div> | 60 | </div> |
61 | {% endif %} | 61 | {% endif %} |
62 | - {% if not user.is_staff %} | 62 | + |
63 | <div class="col-md-5 pull-right category-card-items"> | 63 | <div class="col-md-5 pull-right category-card-items"> |
64 | <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a> | 64 | <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a> |
65 | <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a> | 65 | <a href=""><i class="fa fa-envelope-o" aria-hidden="true"></i></a> |
66 | <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a> | 66 | <a href=""><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></a> |
67 | <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a> | 67 | <a href=""><i class="fa fa-bar-chart" aria-hidden="true"></i></a> |
68 | </div> | 68 | </div> |
69 | - {% endif %} | 69 | + |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | </div> | 72 | </div> |