Skip to content

feat: Add change password and forgot my password #299

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

Merged
merged 58 commits into from
Sep 26, 2021

Conversation

orronai
Copy link
Collaborator

@orronai orronai commented Sep 14, 2021

  • Added tests
  • Added form backend
  • Added template and css style files

orronai and others added 30 commits September 9, 2021 21:51
- Added a html template of the signup page
- Added a href button to the signup page from the login page
- Added the form of the signup to the backend and db
- Added confirmation email system
- Added some tests
- Added a unique salt into confirmation link for each user
- Added a test
- Added few _('...') instead of some english phrases
- Moved out the auth logic into models/users
- Added MAIL_DEFAULT_SENDER variable to the config
- Changed the retrieve_salt method
…ed an error message to the UnhashedPasswordError
- Added tests
- Added a ref link from user's page
- Added the form background
- Added the template and the css style
@lgtm-com
Copy link

lgtm-com bot commented Sep 19, 2021

This pull request introduces 1 alert when merging e3e633d into a04bab5 - view on LGTM.com

new alerts:

  • 1 for Self assignment

@lgtm-com
Copy link

lgtm-com bot commented Sep 19, 2021

This pull request introduces 1 alert when merging e1651c7 into a04bab5 - view on LGTM.com

new alerts:

  • 1 for Self assignment

@lgtm-com
Copy link

lgtm-com bot commented Sep 20, 2021

This pull request introduces 1 alert when merging 418437d into e81fd6f - view on LGTM.com

new alerts:

  • 1 for Self assignment

@lgtm-com
Copy link

lgtm-com bot commented Sep 21, 2021

This pull request introduces 1 alert when merging 33da242 into cd74a56 - view on LGTM.com

new alerts:

  • 1 for Self assignment

with db_config.database.transaction():
for user in table:
user.uuid = uuid4()
user.save()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we save at the end of the transaction? I think it would take significantly less time

@lgtm-com
Copy link

lgtm-com bot commented Sep 22, 2021

This pull request introduces 1 alert when merging 1ca6102 into cd74a56 - view on LGTM.com

new alerts:

  • 1 for Self assignment

Comment on lines 83 to 87
client.post('/change-password', data={
'current_password': 'wrong pass',
'password': 'some_password',
'confirm': 'some_password',
}, follow_redirects=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to extract it to a function

@orronai orronai requested a review from yammesicka September 25, 2021 06:56
@yammesicka yammesicka merged commit 33c8dc8 into master Sep 26, 2021
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 26, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.25%.

Quality metrics Before After Change
Complexity 1.65 ⭐ 1.55 ⭐ -0.10 👍
Method Length 35.77 ⭐ 36.38 ⭐ 0.61 👎
Working memory 6.59 🙂 6.53 🙂 -0.06 👍
Quality 81.38% 81.63% 0.25% 👍
Other metrics Before After Change
Lines 1987 2168 181
Changed files Quality Before Quality After Quality Change
lms/lmsdb/bootstrap.py 76.55% ⭐ 77.74% ⭐ 1.19% 👍
lms/lmsdb/models.py 84.56% ⭐ 84.60% ⭐ 0.04% 👍
lms/lmsweb/views.py 74.25% 🙂 74.80% 🙂 0.55% 👍
lms/lmsweb/tools/validators.py 91.55% ⭐ 91.49% ⭐ -0.06% 👎
lms/models/users.py 90.33% ⭐ 90.65% ⭐ 0.32% 👍
tests/conftest.py 91.92% ⭐ 91.17% ⭐ -0.75% 👎
tests/test_login.py 87.61% ⭐ 93.75% ⭐ 6.14% 👍
tests/test_registration.py 75.95% ⭐ 78.30% ⭐ 2.35% 👍
tests/test_users.py 88.41% ⭐ 82.51% ⭐ -5.90% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
lms/lmsweb/views.py comment 13 🙂 202 😞 8 🙂 50.15% 🙂 Try splitting into smaller methods
lms/lmsweb/views.py login 5 ⭐ 129 😞 12 😞 56.69% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsdb/models.py Solution._base_next_unchecked 0 ⭐ 95 🙂 20 ⛔ 57.42% 🙂 Extract out complex expressions
lms/lmsweb/views.py view 7 ⭐ 134 😞 10 😞 57.80% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsdb/models.py User.notes 1 ⭐ 92 🙂 18 ⛔ 58.26% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@yammesicka yammesicka deleted the add-change-password branch September 26, 2021 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users' password
2 participants