diff --git a/core/views/files.py b/core/views/files.py index ab5dc33b..399b567a 100644 --- a/core/views/files.py +++ b/core/views/files.py @@ -70,7 +70,7 @@ class AddFilesForm(forms.Form): self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % {'file_name': f, 'msg': repr(e)}) if notif: for u in RealGroup.objects.filter(id=settings.SITH_GROUP_COM_ADMIN_ID).first().users.all(): - if not u.notifications.filter(type="FILE_MODERATION").exists(): + if not u.notifications.filter(type="FILE_MODERATION", viewed=False).exists(): Notification(user=u, url=reverse("core:file_moderation"), type="FILE_MODERATION").save() class FileListView(ListView): diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 64539d8e..2c7bf1b9 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -2962,7 +2962,7 @@ msgstr "Personne(s)" #: sas/templates/sas/picture.jinja:81 msgid "Moderator: " -msgstr "Modérateur" +msgstr "Modérateur : " #: sas/templates/sas/picture.jinja:87 msgid "HD version" diff --git a/sas/views.py b/sas/views.py index d12dbe95..62ee35f5 100644 --- a/sas/views.py +++ b/sas/views.py @@ -50,7 +50,7 @@ class SASForm(forms.Form): self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % {'file_name': f, 'msg': repr(e)}) if notif: for u in RealGroup.objects.filter(id=settings.SITH_GROUP_SAS_ADMIN_ID).first().users.all(): - if not u.notifications.filter(type="SAS_MODERATION").exists(): + if not u.notifications.filter(type="SAS_MODERATION", viewed=False).exists(): Notification(user=u, url=reverse("sas:moderation"), type="SAS_MODERATION").save() class RelationForm(forms.ModelForm): @@ -122,7 +122,7 @@ class PictureView(CanViewMixin, DetailView, FormMixin): u = User.objects.filter(id=uid).first() PeoplePictureRelation(user=u, picture=self.form.cleaned_data['picture']).save() - if not u.notifications.filter(type="NEW_PICTURES").exists(): + if not u.notifications.filter(type="NEW_PICTURES", viewed=False).exists(): Notification(user=u, url=reverse("core:user_pictures", kwargs={'user_id': u.id}), type="NEW_PICTURES").save() return super(PictureView, self).form_valid(self.form) else: