Commit 14f4df7ef8fb3bab892e21666836e30877f73c78
1 parent
1471f570
Exists in
master
and in
3 other branches
Post adjusts
Showing
2 changed files
with
9 additions
and
9 deletions
Show diff stats
mural/templatetags/mural_filters.py
... | ... | @@ -66,14 +66,14 @@ def show_settings(post, user): |
66 | 66 | return True |
67 | 67 | |
68 | 68 | if post._my_subclass == "categorypost": |
69 | - if post.space.coordinators == user: | |
69 | + if post.categorypost.space.coordinators == user: | |
70 | 70 | return True |
71 | 71 | |
72 | 72 | if post._my_subclass == "subjectpost": |
73 | - if post.space.professor == user: | |
73 | + if post.subjectpost.space.professor == user: | |
74 | 74 | return True |
75 | 75 | |
76 | - if post.space.category.coordinators == user: | |
76 | + if post.subjectpost.space.category.coordinators == user: | |
77 | 77 | return True |
78 | 78 | |
79 | 79 | return False |
... | ... | @@ -87,14 +87,14 @@ def show_settings_comment(comment, user): |
87 | 87 | return True |
88 | 88 | |
89 | 89 | if comment.post._my_subclass == "categorypost": |
90 | - if comment.post.space.coordinators == user: | |
90 | + if comment.post.categorypost.space.coordinators == user: | |
91 | 91 | return True |
92 | 92 | |
93 | 93 | if comment.post._my_subclass == "subjectpost": |
94 | - if comment.post.space.professor == user: | |
94 | + if comment.post.subjectpost.space.professor == user: | |
95 | 95 | return True |
96 | 96 | |
97 | - if comment.post.space.category.coordinators == user: | |
97 | + if comment.post.subjectpost.space.category.coordinators == user: | |
98 | 98 | return True |
99 | 99 | |
100 | 100 | return False | ... | ... |
mural/views.py
... | ... | @@ -322,7 +322,7 @@ class CategoryCreate(LoginRequiredMixin, generic.edit.CreateView): |
322 | 322 | |
323 | 323 | self.object.save() |
324 | 324 | |
325 | - users = User.objects.filter(Q(is_staff = True) | Q(coordinators = cat) | Q(professors__category = cat) | Q(subject_student__category = cat)).exclude(id = self.request.user.id) | |
325 | + users = getSpaceUsers(self.request.user.id, self.object) | |
326 | 326 | entries = [] |
327 | 327 | |
328 | 328 | notify_type = "mural" |
... | ... | @@ -370,7 +370,7 @@ class CategoryUpdate(LoginRequiredMixin, generic.UpdateView): |
370 | 370 | |
371 | 371 | self.object.save() |
372 | 372 | |
373 | - users = User.objects.all().exclude(id = self.request.user.id) | |
373 | + users = getSpaceUsers(self.request.user.id, self.object) | |
374 | 374 | |
375 | 375 | notify_type = "mural" |
376 | 376 | _view = render_to_string("mural/_view.html", {"post": self.object}, self.request) |
... | ... | @@ -407,7 +407,7 @@ class CategoryDelete(LoginRequiredMixin, generic.DeleteView): |
407 | 407 | return context |
408 | 408 | |
409 | 409 | def get_success_url(self): |
410 | - users = User.objects.all().exclude(id = self.request.user.id) | |
410 | + users = getSpaceUsers(self.request.user.id, self.object) | |
411 | 411 | |
412 | 412 | notify_type = "mural" |
413 | 413 | pathname = reverse("mural:manage_category") | ... | ... |