Commit 56b5fa73 authored by Krophil's avatar Krophil
Browse files

Small fixes on news

parent 3e769195
Pipeline #1275 passed with stage
in 8 minutes and 48 seconds
...@@ -240,7 +240,7 @@ class NewsCreateView(CanCreateMixin, CreateView): ...@@ -240,7 +240,7 @@ class NewsCreateView(CanCreateMixin, CreateView):
else: else:
for u in RealGroup.objects.filter(id=settings.SITH_GROUP_COM_ADMIN_ID).first().users.all(): for u in RealGroup.objects.filter(id=settings.SITH_GROUP_COM_ADMIN_ID).first().users.all():
if not u.notifications.filter(type="NEWS_MODERATION", viewed=False).exists(): if not u.notifications.filter(type="NEWS_MODERATION", viewed=False).exists():
Notification(user=u, url=reverse("com:news_detail", kwargs={'news_id': self.object.id}), type="NEWS_MODERATION").save() Notification(user=u, url=reverse("com:news_admin_list"), type="NEWS_MODERATION").save()
return super(NewsCreateView, self).form_valid(form) return super(NewsCreateView, self).form_valid(form)
...@@ -248,6 +248,8 @@ class NewsDeleteView(CanEditMixin, DeleteView): ...@@ -248,6 +248,8 @@ class NewsDeleteView(CanEditMixin, DeleteView):
model = News model = News
pk_url_kwarg = 'news_id' pk_url_kwarg = 'news_id'
template_name = 'core/delete_confirm.jinja' template_name = 'core/delete_confirm.jinja'
success_url = reverse_lazy('com:news_admin_list')
class NewsModerateView(CanEditMixin, SingleObjectMixin): class NewsModerateView(CanEditMixin, SingleObjectMixin):
model = News model = News
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment