mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Notification fix
This commit is contained in:
parent
97f7214f01
commit
642249e7fb
@ -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)})
|
self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % {'file_name': f, 'msg': repr(e)})
|
||||||
if notif:
|
if notif:
|
||||||
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="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()
|
Notification(user=u, url=reverse("core:file_moderation"), type="FILE_MODERATION").save()
|
||||||
|
|
||||||
class FileListView(ListView):
|
class FileListView(ListView):
|
||||||
|
@ -2962,7 +2962,7 @@ msgstr "Personne(s)"
|
|||||||
|
|
||||||
#: sas/templates/sas/picture.jinja:81
|
#: sas/templates/sas/picture.jinja:81
|
||||||
msgid "Moderator: "
|
msgid "Moderator: "
|
||||||
msgstr "Modérateur"
|
msgstr "Modérateur : "
|
||||||
|
|
||||||
#: sas/templates/sas/picture.jinja:87
|
#: sas/templates/sas/picture.jinja:87
|
||||||
msgid "HD version"
|
msgid "HD version"
|
||||||
|
@ -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)})
|
self.add_error(None, _("Error uploading file %(file_name)s: %(msg)s") % {'file_name': f, 'msg': repr(e)})
|
||||||
if notif:
|
if notif:
|
||||||
for u in RealGroup.objects.filter(id=settings.SITH_GROUP_SAS_ADMIN_ID).first().users.all():
|
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()
|
Notification(user=u, url=reverse("sas:moderation"), type="SAS_MODERATION").save()
|
||||||
|
|
||||||
class RelationForm(forms.ModelForm):
|
class RelationForm(forms.ModelForm):
|
||||||
@ -122,7 +122,7 @@ class PictureView(CanViewMixin, DetailView, FormMixin):
|
|||||||
u = User.objects.filter(id=uid).first()
|
u = User.objects.filter(id=uid).first()
|
||||||
PeoplePictureRelation(user=u,
|
PeoplePictureRelation(user=u,
|
||||||
picture=self.form.cleaned_data['picture']).save()
|
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()
|
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)
|
return super(PictureView, self).form_valid(self.form)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user