Fixes errors in permissions
This commit is contained in:
parent
948f2964ac
commit
a972c58f3b
6 changed files with 13 additions and 8 deletions
|
@ -222,8 +222,12 @@ def notify_user_on_import_complete(
|
|||
@receiver(models.signals.post_save, sender=Report)
|
||||
@transaction.atomic
|
||||
# pylint: disable=unused-argument
|
||||
def notify_admins_on_report(sender, instance, *args, **kwargs):
|
||||
def notify_admins_on_report(sender, instance, created, *args, **kwargs):
|
||||
"""something is up, make sure the admins know"""
|
||||
if not created:
|
||||
# otherwise you'll get a notification when you resolve a report
|
||||
return
|
||||
|
||||
# moderators and superusers should be notified
|
||||
admins = User.objects.filter(
|
||||
models.Q(user_permissions__name__in=["moderate_user", "moderate_post"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue