Signals are not being sent/ received
I am working on an application that utilizes the signals emitted from the user_added and user_removed events from organizations.signals. However, they don't appear to be firing, or I am unable to receive them. Signals defined from my own application are being received. Below is the extracted sample:
from organizations.signals import user_added, user_removed
from organizations.models import Organization
from django.dispatch import receiver
@receiver(user_added, sender=Organization)
def usercreated(sender, **kwargs):
print("A User was added")
@receiver(user_removed, sender=Organization)
def userremoved(sender, **kwargs):
print("A User was removed")
It appears as though the tests in Travis are passing on the latest build. Working with Django 1.10.5, django-organizations .90, and Python 3.6. Actions were taken both from the Admin dashboard as well as with the actions defined in the /organizations application space, though they should be the same.
For context, which organization models are you using? The concrete models? Abstract base models?
I'm using the concrete models, the default installation as defined in the documentation. It looks to me as if the get_or_add_user and the add_user method in the abstract models isn't being called anywhere else though, which is why the signal isn't being sent.
Apologize if I misunderstand the relationship between the Concrete models and the Abstract models, it looks like the concrete models defined in the .models file are simply extensions of the abstract models. Please correct me if I'm wrong though.
On Feb 22, 2017 1:00 PM, "Ben Lopatin" [email protected] wrote:
For context, which organization models are you using? The concrete models? Abstract base models?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bennylope/django-organizations/issues/123#issuecomment-281749939, or mute the thread https://github.com/notifications/unsubscribe-auth/AMPVJU93HlcnLnWuHgXqcUbRYky9xesbks5rfHfMgaJpZM4MFwLH .
I am also running into this issue except we're using the abstract models + our own Org models.
It does appear that using the django admin area to add / remove users to an organization doesn't use the add_user / etc methods.
But if you call them directly the signals do fire.