new user update endpoint - #162
Merged
melvinsoft merged 2 commits intoSep 20, 2017
Merged
Conversation
melvinsoft
force-pushed
the
maxi/new-user-update-endpoint
branch
from
September 9, 2017 17:46
4bc92a6 to
bb303d0
Compare
fix in case custom form doesn't exists docs for the new endpoint remove prints
melvinsoft
force-pushed
the
maxi/new-user-update-endpoint
branch
from
September 9, 2017 17:53
bb303d0 to
95c7097
Compare
tkeemon
suggested changes
Sep 13, 2017
tkeemon
left a comment
There was a problem hiding this comment.
Looks good to me. Just one minor change.
| # update email | ||
| if 'email' in data: | ||
| user.email = data['email'] | ||
| user.save() |
There was a problem hiding this comment.
You need to watch out for an IntegrityError here. If a request attempts to change an email address to one already in use, then this will error out.
Author
There was a problem hiding this comment.
@tkeemon Great catch, change addressed, but to my surprise, I can have two users with the same email, the IntegrityError isn't triggered. So I added the same check that we've in other endpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New endpoint to update user attributes, please check the docs added first.