Skip to content

Conversation

@yashikajotwani12
Copy link
Contributor

@yashikajotwani12 yashikajotwani12 commented Jun 10, 2022

Before:
Screenshot from 2022-06-10 17-34-49

Update:
Screenshot from 2022-06-10 17-27-06

Fixes #238

@yashikajotwani12 yashikajotwani12 marked this pull request as draft June 10, 2022 11:14
@yashikajotwani12 yashikajotwani12 force-pushed the issue-238-org-does-not-exit branch from 870c7c8 to 244c330 Compare June 10, 2022 11:24
@yashikajotwani12 yashikajotwani12 marked this pull request as ready for review June 10, 2022 11:59
@yashikajotwani12 yashikajotwani12 changed the title [bug] Organization.DoesNotExist #238 [bug] Organization matching query does not exist #238 Jun 10, 2022
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))
Copy link
Member

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.

Suggested change
transaction.on_commit(lambda: tasks.ns_organization_created.delay(instance.pk))
if created:
transaction.on_commit(lambda: tasks.ns_organization_created.delay(instance.pk))

Copy link
Member

@atb00ker atb00ker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 😄

@atb00ker atb00ker requested a review from nemesifier June 25, 2022 07:44
@nemesifier nemesifier changed the title [bug] Organization matching query does not exist #238 [fix] Organization matching query does not exist #238 Jun 30, 2022
@nemesifier nemesifier merged commit 3b4d584 into master Jun 30, 2022
@nemesifier nemesifier deleted the issue-238-org-does-not-exit branch June 30, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Organization.DoesNotExist openwisp_notifications.tasks.ns_organization_created

4 participants