fix missing access to topic
This commit is contained in:
@@ -89,7 +89,7 @@ class TopicDetailView(LoginRequiredMixin, DetailView):
|
|||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||||
return Topic.objects.filter(Q(topic_group__slug=topic_group_slug))
|
return Topic.objects.filter(topic_group__slug=topic_group_slug)
|
||||||
|
|
||||||
|
|
||||||
class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
||||||
@@ -102,10 +102,9 @@ class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
|||||||
add_log_action(self.request, form, "intern", "topic", False)
|
add_log_action(self.request, form, "intern", "topic", False)
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_queryset(self):
|
||||||
context = super().get_context_data(**kwargs)
|
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||||
context["topic"] = self.object
|
return Topic.objects.filter(topic_group__slug=topic_group_slug)
|
||||||
return context
|
|
||||||
|
|
||||||
|
|
||||||
class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
||||||
|
|||||||
Reference in New Issue
Block a user