-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Model & migration for domain-scoped API keys #28608
Conversation
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.
Approved, although may make sense to drop one hunk (see comment).
corehq/apps/users/models.py
Outdated
@@ -3080,4 +3081,6 @@ def role(self): | |||
return UserRole.get(self.role_id) | |||
except ResourceNotFound: | |||
logging.exception('no role with id %s found in domain %s' % (self.role_id, self.domain)) | |||
elif self.domain: | |||
return CouchUser.from_django_user(self.user).get_domain_membership(self.domain).role |
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 looks like a behavior change. Curious why it was included in this PR?
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.
Yeah, I agree, I should drop that. I'm probably going to amend this commit instead of adding a new one, so that when we merge the original branch we get a conflict instead of the risk of dropping these two lines by accident. (I'm not sure I explained that very well. And I think we'd get a conflict either way. But I'd hate Git to apply the "drop those lines" commit to the second merge.)
(I also forgot to rename that migration.)
7e6039e
to
04799ea
Compare
thanks for picking this up! |
This PR cherrypicks 2 commits from PR #28493 , to follow up @millerdev's comment here.
It separates out the model change and corresponding migration from the rest of the PR, in order to eliminate the risk of complications if we need to roll back the feature.
RISK ASSESSMENT / QA PLAN
QA has just passed for the original PR.
cc @millerdev