Description: Fix False-Positive exception logs in Membership rules
Both USER_ACCOUNT_ACTIVATED and REGISTER_USER signals call Membership.create_from_rules to create membership rules. The problem is that USER_ACCOUNT_ACTIVATED will always fail for newly registered users because the user is not linked to an organization yet, then REGISTER_USER will fix the membership issue.
This fix is to avoid logging exceptions for Organization.DoesNotExist anymore in on_learner_account_activated (which is triggered by USER_ACCOUNT_ACTIVATED)
_Why we're keeping the call? why not remove it and rely on on_learner_register?_
This is just for rare cases where the user is deactivated and then reactivated later by an admin
Description: Fix False-Positive exception logs in Membership rules
Both
USER_ACCOUNT_ACTIVATED
andREGISTER_USER
signals callMembership.create_from_rules
to create membership rules. The problem is thatUSER_ACCOUNT_ACTIVATED
will always fail for newly registered users because the user is not linked to an organization yet, thenREGISTER_USER
will fix the membership issue.This fix is to avoid logging exceptions for
Organization.DoesNotExist
anymore inon_learner_account_activated
(which is triggered byUSER_ACCOUNT_ACTIVATED
)_Why we're keeping the call? why not remove it and rely on
on_learner_register
?_ This is just for rare cases where the user is deactivated and then reactivated later by an adminJIRA: https://appsembler.atlassian.net/browse/RED-3674
Dependencies: dependencies on other outstanding PRs, issues, etc.
Merge deadline: List merge deadline (if any)
Installation instructions: List any non-trivial installation instructions.
Testing instructions:
Reviewers:
Merge checklist:
Post merge:
Author concerns: List any concerns about this PR - inelegant solutions, hacks, quick-and-dirty implementations, concerns about migrations, etc.