-
-
Notifications
You must be signed in to change notification settings - Fork 62
[fix] Organization matching query does not exist #238 #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
870c7c8 to
244c330
Compare
openwisp_notifications/handlers.py
Outdated
| if created: | ||
| tasks.ns_organization_created.delay(instance.pk) | ||
| def notification_setting_org_created(instance, **kwargs): | ||
| transaction.on_commit(lambda: tasks.ns_organization_created.delay(instance.pk)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic must be executed only when an organization is created, otherwise it will be executed any time an organization is updated, which we do not want.
| transaction.on_commit(lambda: tasks.ns_organization_created.delay(instance.pk)) | |
| if created: | |
| transaction.on_commit(lambda: tasks.ns_organization_created.delay(instance.pk)) |
atb00ker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😄
Before:

Update:

Fixes #238