Notification emails #80
@ -101,6 +101,9 @@ def _setup_followers(
|
|||||||
|
|
||||||
@receiver(m2m_changed, sender=Extension.authors.through)
|
@receiver(m2m_changed, sender=Extension.authors.through)
|
||||||
def _update_authors_follow(instance, action, model, reverse, pk_set, **kwargs):
|
def _update_authors_follow(instance, action, model, reverse, pk_set, **kwargs):
|
||||||
|
if action not in ['post_add', 'post_remove']:
|
||||||
|
return
|
||||||
|
|
||||||
if model == Extension and not reverse:
|
if model == Extension and not reverse:
|
||||||
users = [instance]
|
users = [instance]
|
||||||
extensions = Extension.objects.filter(pk__in=pk_set)
|
extensions = Extension.objects.filter(pk__in=pk_set)
|
||||||
|
@ -48,6 +48,9 @@ def update_moderator_follows(instance, action, model, reverse, pk_set, **kwargs)
|
|||||||
The flag=Flag.MODERATOR is used to avoid deleting follow relations that were created in contexts
|
The flag=Flag.MODERATOR is used to avoid deleting follow relations that were created in contexts
|
||||||
other than moderator's duties.
|
other than moderator's duties.
|
||||||
"""
|
"""
|
||||||
|
if action not in ['post_add', 'post_remove']:
|
||||||
|
return
|
||||||
|
|
||||||
moderators = Group.objects.get(name='moderators')
|
moderators = Group.objects.get(name='moderators')
|
||||||
extensions = Extension.objects.all()
|
extensions = Extension.objects.all()
|
||||||
users = []
|
users = []
|
||||||
|
Loading…
Reference in New Issue
Block a user