mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Merge branch 'bugfix' into 'master'
Small fix on news deletion See merge request !115
This commit is contained in:
commit
d2fccdb09b
@ -240,7 +240,7 @@ class NewsCreateView(CanCreateMixin, CreateView):
|
||||
else:
|
||||
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():
|
||||
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)
|
||||
|
||||
|
||||
@ -248,6 +248,8 @@ class NewsDeleteView(CanEditMixin, DeleteView):
|
||||
model = News
|
||||
pk_url_kwarg = 'news_id'
|
||||
template_name = 'core/delete_confirm.jinja'
|
||||
success_url = reverse_lazy('com:news_admin_list')
|
||||
|
||||
|
||||
class NewsModerateView(CanEditMixin, SingleObjectMixin):
|
||||
model = News
|
||||
|
Loading…
Reference in New Issue
Block a user