Skip to content
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

feat: Add registration page #286

Merged
merged 31 commits into from
Sep 14, 2021
Merged

feat: Add registration page #286

merged 31 commits into from
Sep 14, 2021

Conversation

orronai
Copy link
Collaborator

@orronai orronai commented Sep 9, 2021

  • 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 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
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #286 (871d6e4) into master (bed689c) will increase coverage by 0.81%.
The diff coverage is 97.47%.

❗ Current head 871d6e4 differs from pull request most recent head f44f1a2. Consider uploading reports for the commit f44f1a2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #286      +/-   ##
==========================================
+ Coverage   78.98%   79.80%   +0.81%     
==========================================
  Files          55       59       +4     
  Lines        2346     2451     +105     
==========================================
+ Hits         1853     1956     +103     
- Misses        493      495       +2     
Impacted Files Coverage Δ
lms/models/users.py 88.88% <88.88%> (ø)
lms/models/register.py 94.44% <94.44%> (ø)
lms/lmsdb/models.py 90.78% <100.00%> (+0.34%) ⬆️
lms/lmsweb/__init__.py 96.55% <100.00%> (+0.25%) ⬆️
lms/lmsweb/forms/register.py 100.00% <100.00%> (ø)
lms/lmsweb/tools/validators.py 100.00% <100.00%> (ø)
lms/lmsweb/views.py 90.02% <100.00%> (+1.10%) ⬆️
lms/models/errors.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bed689c...f44f1a2. Read the comment docs.

lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/templates/_formhelpers.html Show resolved Hide resolved
lms/templates/login.html Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
- Added confirmation email system
- Added some tests
@lgtm-com
Copy link

lgtm-com bot commented Sep 10, 2021

This pull request introduces 1 alert when merging 6ad4d4d into 4e4c203 - view on LGTM.com

new alerts:

  • 1 for Unused import

@orronai orronai linked an issue Sep 11, 2021 that may be closed by this pull request
4 tasks
lms/lmsdb/models.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/registration.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Show resolved Hide resolved
- Added a unique salt into confirmation link for each user
- Added a test
@lgtm-com
Copy link

lgtm-com bot commented Sep 11, 2021

This pull request introduces 1 alert when merging 2da74c3 into bed689c - view on LGTM.com

new alerts:

  • 1 for Use of the return value of a procedure

@lgtm-com
Copy link

lgtm-com bot commented Sep 11, 2021

This pull request introduces 1 alert when merging eb717f1 into bed689c - view on LGTM.com

new alerts:

  • 1 for Use of the return value of a procedure

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

Awesome work 🔥

Added few improvement suggestions, please take a look :)

lms/lmsweb/tools/validators.py Outdated Show resolved Hide resolved
lms/lmsweb/tools/validators.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved

return redirect(url_for(
'login', login_message=(
_('המשתמש שלך אומת בהצלחה, כעת הינך יכול להתחבר למערכת'),
Copy link
Member

Choose a reason for hiding this comment

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

אתה מועבר לדף ההתחברות (הינך בד"כ נחשב כהגבהה מלאכותית)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed it into אתה but now the whole sentence because he is already in the login page, the user just see the mesage that his user has been successfully confirmed and he can login

lms/models/register.py Outdated Show resolved Hide resolved
lms/models/register.py Outdated Show resolved Hide resolved
lms/models/register.py Outdated Show resolved Hide resolved
lms/templates/signup.html Outdated Show resolved Hide resolved
- 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
tests/test_registration.py Show resolved Hide resolved
tests/samples/config.py.example Outdated Show resolved Hide resolved
lms/models/users.py Outdated Show resolved Hide resolved
lms/models/users.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@orronai orronai left a comment

Choose a reason for hiding this comment

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

Changed

lms/lmsweb/views.py Outdated Show resolved Hide resolved
lms/lmsweb/views.py Outdated Show resolved Hide resolved
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 14, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.78 ⭐ 1.73 ⭐ -0.05 👍
Method Length 33.46 ⭐ 33.42 ⭐ -0.04 👍
Working memory 6.42 🙂 6.39 🙂 -0.03 👍
Quality 82.35% 82.41% 0.06% 👍
Other metrics Before After Change
Lines 1575 1700 125
Changed files Quality Before Quality After Quality Change
lms/lmsdb/models.py 84.38% ⭐ 84.56% ⭐ 0.18% 👍
lms/lmsweb/init.py 56.91% 🙂 54.82% 🙂 -2.09% 👎
lms/lmsweb/views.py 74.64% 🙂 74.25% 🙂 -0.39% 👎
lms/models/errors.py 95.58% ⭐ 94.91% ⭐ -0.67% 👎
tests/conftest.py 91.19% ⭐ 92.02% ⭐ 0.83% 👍
tests/test_flask_limiter.py 83.28% ⭐ 83.58% ⭐ 0.30% 👍
tests/test_login.py 88.75% ⭐ 87.61% ⭐ -1.14% 👎
tests/test_users.py 88.27% ⭐ 88.41% ⭐ 0.14% 👍
tests/samples/config_copy.py 96.18% ⭐ 96.18% ⭐ 0.00%

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 ⭐ 124 😞 12 😞 57.29% 🙂 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!

@orronai orronai merged commit a04bab5 into master Sep 14, 2021
@orronai orronai deleted the add-signup-page branch September 22, 2021 12:27
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' registration
2 participants