-
Notifications
You must be signed in to change notification settings - Fork 34
feat: Add registration page #286
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
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2cf26ed
feat: Add registration page
orronai 3913a5e
feat: Add registration page
orronai d206c6a
Fixed sourcey-ai issues
orronai 6ad4d4d
fixed resend email confirmation
orronai 5acbda2
Merge branch 'master' of https://github.com/PythonFreeCourse/lms into…
orronai 6b137af
Added translations
orronai 3798a2d
Removed unused module
orronai 1377e9a
Changed versions of requirements
orronai 93da860
Changed versions of requirements
orronai ec52300
Changed versions of requirements
orronai 4e47d57
Changed versions of requirements
orronai 8d08863
Changed versions of requirements
orronai 366b53f
Changed versions of requirements
orronai 1443bad
Removed versions change
orronai 1d00a27
Fixed tests
orronai 036bdf5
Fixed a test
orronai b426102
Fixed test and updated client fixture
orronai c2ffa37
Added tests for coverage
orronai a9c22c9
Merge branch 'master' into add-signup-page
orronai b8dff02
- Changed role name from not_confirmed into unverified
orronai 2da74c3
Fixed conflict
orronai fda1558
Added a test for signature expired
orronai 6ad81a2
Removed unnecessary condition
orronai eb717f1
Added role attribute
orronai 7e87dad
- Fixed babel translations
orronai 19ecb65
Fixed a test to check bad signature token
orronai 71fbb2f
Fixed a test
orronai d4bd32a
Moved out the HASHED_PASSWORD in order to be global variable, and add…
orronai 436fc9f
Added a configuration of registration open, and a test
orronai d34d19d
Added flask limits and fixed some messages
orronai f44f1a2
Removed formats from strings
orronai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from flask_babel import gettext as _ # type: ignore | ||
from wtforms.validators import ValidationError | ||
|
||
from lms.lmsdb.models import User | ||
|
||
|
||
def UniqueUsernameRequired(form, field): | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
username_exists = User.get_or_none(User.username == field.data) | ||
if username_exists: | ||
raise ValidationError(_('שם המשתמש כבר נמצא בשימוש')) | ||
|
||
|
||
def UniqueEmailRequired(form, field): | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
email_exists = User.get_or_none(User.mail_address == field.data) | ||
if email_exists: | ||
raise ValidationError(_('האימייל כבר נמצא בשימוש')) | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% macro render_field(field, cls) %} | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div class="row mb-3"> | ||
<label for="{{ field.id }}" class="visually-hidden">{{ field.label }}</label> | ||
{{ field(class=cls, **kwargs) | safe }} | ||
<div id="signup-errors" class="text-center"> | ||
{% if field.errors %} | ||
{% for error in field.errors %} | ||
<span>{{ error }}</span> | ||
{% endfor %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endmacro %} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends 'base.html' %} | ||
{% from "_formhelpers.html" import render_field %} | ||
|
||
{% block page_content %} | ||
<div class="container"> | ||
<div id="signup-container"> | ||
<div id="signup" class="text-center"> | ||
<img id="signup-logo" src="{{ url_for('static', filename='avatar.jpg') }}" alt="{{ _('תמונת הפרופיל של קורס פייתון') }}" width="72" height="72"> | ||
<h1 id="main-title" class="h3 font-weight-normal">{{ _('הרשמה') }}</h1> | ||
<p> | ||
{{ _('ברוכים הבאים למערכת התרגילים!') }}<br> | ||
{{ _('הזינו אימייל וסיסמה לצורך רישום למערכת:') }} | ||
</p> | ||
<form class="align-items-center" method="post" action="/signup"> | ||
{{ render_field(form.email, cls="form-control form-control-lg", placeholder="Email Address") }} | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{ render_field(form.username, cls="form-control form-control-lg", placeholder="User Name") }} | ||
{{ render_field(form.fullname, cls="form-control form-control-lg", placeholder="Full Name") }} | ||
{{ render_field(form.password, cls="form-control form-control-lg", placeholder="Password") }} | ||
{{ render_field(form.confirm, cls="form-control form-control-lg", placeholder="Password Verification") }} | ||
<input class="form-control form-control-lg" type="hidden" name="csrf_token" id="csrf_token" value="{{ csrf_token() }}" required> | ||
<input class="form-control form-control-lg" type="hidden" name="next" id="next" value="{{ request.args.get('next', '') }}"> | ||
<button class="btn btn-primary btn-lg btn-block">{{ _('הירשם') }}</button> | ||
</form> | ||
<hr class="mt-3 mb-3"/> | ||
<a href="/" class="btn btn-success btn-sm" role="button">{{ _('חזרה לדף ההתחברות') }}</a> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.