-
Notifications
You must be signed in to change notification settings - Fork 447
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
Fix:updating an user with empty username and name gives an error message #695
Conversation
f8c5f94
to
e72328f
Compare
Codecov Report
@@ Coverage Diff @@
## develop #695 +/- ##
===========================================
+ Coverage 95.84% 95.86% +0.02%
===========================================
Files 95 95
Lines 5200 5230 +30
===========================================
+ Hits 4984 5014 +30
Misses 216 216
|
3924d92
to
767d7de
Compare
ddc91b4
to
9e16dec
Compare
7c5a31b
to
266c429
Compare
@anitab-org/coding-team This PR needs review. Thanks! |
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.
Some basic style changes
if data["name"]: | ||
user.name = data["name"] | ||
else: | ||
return messages.NAME_FIELD_IS_MISSING,HTTPStatus.OK |
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.
I'd rewrite this as:
try:
user.name = data["name"]
except KeyError:
return ....
@rashikaqureshi please do the changes as requested |
@rashikaqureshi Closing the PR due to no update response and inactivity. |
while updating user details if the username or name is empty. then added an error message.
Fixes #598
Tested these scenarios. Earlier for these scenarios error message was - user was updated successfully.
Now populating a different error message. Hence receiving errors.
Code/Quality Assurance Only
Code/Quality Assurance Only