Add chance to change password of the account#1735
Conversation
|
The code was able to change the password successfully. I don't know if the code is good enough. Suggest some changes! |
Codecov Report
@@ Coverage Diff @@
## develop #1735 +/- ##
===========================================
+ Coverage 66.75% 74.64% +7.88%
===========================================
Files 95 328 +233
Lines 3706 11239 +7533
Branches 519 1236 +717
===========================================
+ Hits 2474 8389 +5915
- Misses 941 2340 +1399
- Partials 291 510 +219
... and 138 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
mlodic
left a comment
There was a problem hiding this comment.
seems pretty clean.
could you just put the "change password" section before the "plugin configuration" section? I think it makes more sense in terms of usability because this section is a concept very similar to the API sessions one
| # Check if the old password matches the user's current password | ||
| user = request.user | ||
| if not check_password(old_password, user.password): | ||
| # Return an error response if the old password doesn't match |
authentication/views.py
Outdated
| # Check if the old password matches the user's current password | ||
| user = request.user | ||
| if not check_password(old_password, user.password): | ||
| logger.info("Invalid old password") |
There was a problem hiding this comment.
could you please log the user too?
There was a problem hiding this comment.
otherwise it's impossible to debug that behavior and the log is almost useless
There was a problem hiding this comment.
logger.info(f"{uname} has inputted invalid old password")
will this work
or something like
logger.info(f"ChangePasswordView:{uname} inputted invalid old password")
|
great! :) |


closes #1285
Description
add a feature to allow the user to change their password
Type of change
Checklist
develop_monkeypatch()was used in its class to apply the necessary decorators.test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook inplaybook_config.json.Black,Flake,Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors.