forked from isichos/epa
-
Notifications
You must be signed in to change notification settings - Fork 6
Add passwort reset #188
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
Add passwort reset #188
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5555b36
Fix CI by switching from mysql to postgres requirements install
4lm 414cd82
Remove obsolete HTML artefact
4lm 07e1702
Remove obsolete HTML artefact from signup template
4lm f935bb6
Add password reset templates
4lm 6ab4c8c
Enable password reset
4lm 2a86071
Make black happy
4lm b923d7a
Default DEBUG to False (security) and use console email backend only …
4lm c2ef4cc
Remove unused tokens module
4lm 5d8e04c
Re-enable email confirmation functionality #192
4lm 550941a
Use messaging system, not plain text for info and success messages, f…
4lm 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
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 @@ | ||
| {% extends 'base.html' %} | ||
| {% load i18n %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| <div class="container p-5"> | ||
| <h2 class="font-weight-bold mt-3">{% trans "Password reset complete" %}</h2> | ||
| <hr> | ||
| <p>{% trans "Your password has been set. You may go ahead and log in now." %}</p> | ||
| <a href="{% url 'login' %}" class="btn btn-primary">{% trans "Log in" %}</a> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {% extends 'base.html' %} | ||
| {% load i18n %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| {% load crispy_forms_tags %} | ||
|
|
||
| <div class="container p-5"> | ||
| <h2 class="font-weight-bold mt-3">{% trans "Password Reset Confirm" %}</h2> | ||
| <hr> | ||
| <p>{% trans "Please enter your new password." %}</p> | ||
| <form method="POST"> | ||
| {% csrf_token %} | ||
| {{ form|crispy }} | ||
| <button class="btn btn-primary" type="submit">{% trans "Reset password" %}</button> | ||
| </form> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| {% extends 'base.html' %} | ||
| {% load i18n %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| <div class="container p-5"> | ||
| <h2 class="font-weight-bold mt-3">{% trans "Password reset sent" %}</h2> | ||
| <hr> | ||
| <p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p> | ||
| <p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %} | ||
| </p> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {% extends 'base.html' %} | ||
| {% load i18n %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| {% load crispy_forms_tags %} | ||
|
|
||
| <div class="container p-5"> | ||
| <h2 class="font-weight-bold mt-3">{% trans "Reset Password" %}</h2> | ||
| <hr> | ||
| <p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p> | ||
| <form method="POST"> | ||
| {% csrf_token %} | ||
| {{ form|crispy }} | ||
| <button class="btn btn-primary" type="submit">{% trans "Send email" %}</button> | ||
| </form> | ||
| </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
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 |
|---|---|---|
| @@ -1,55 +1,52 @@ | ||
| {% extends 'base.html' %} | ||
| {% load i18n %} | ||
|
|
||
| {% load crispy_forms_tags %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| <main> | ||
| <section class="header"> | ||
| <div> | ||
| <div class="header__left"></div> | ||
| <h1 class="header__title">Account</h1> | ||
| <div class="header__back"></div> | ||
| </div> | ||
| </section> | ||
| <section class="standard-layout"> | ||
| <div> | ||
| <div class="account"> | ||
| <div> | ||
| <form method="post"> | ||
| {% csrf_token %} | ||
| {{ form|crispy }} | ||
| <br> | ||
| <div class="row"> | ||
| <div class="col-sm-4"></div> | ||
| <div class="col-sm-4"> | ||
| <button class="btn btn-primary btn-lg" type="submit">Save Changes | ||
| </button> | ||
| <main> | ||
| <section class="header"> | ||
| <div> | ||
| <div class="header__left"></div> | ||
| <h1 class="header__title">Account</h1> | ||
| <div class="header__back"></div> | ||
| </div> | ||
| </section> | ||
| <section class="standard-layout"> | ||
| <div> | ||
| <div class="account"> | ||
| <div> | ||
| <form method="post"> | ||
| {% csrf_token %} | ||
| {{ form|crispy }} | ||
| <br> | ||
| <div class="row"> | ||
| <div class="col-sm-4"></div> | ||
| <div class="col-sm-4"> | ||
| <button class="btn btn-primary btn-lg" | ||
| type="submit">Save Changes | ||
| </button> | ||
| </div> | ||
| <div class="col-sm-4"></div> | ||
| </div> | ||
| <div class="col-sm-4"></div> | ||
| </div> | ||
| <br> | ||
| </form> | ||
| <!--<form> | ||
| <div class="mb-3"> | ||
| <label for="nameInput" class="form-label">Name</label> | ||
| <input type="email" class="form-control" id="nameInput" value="Christian Müller"> | ||
| </div> | ||
| <div class="mb-3"> | ||
| <label for="emailInput" class="form-label">Email address</label> | ||
| <input type="email" class="form-control" id="emailInput" value="christian.mueller@gmail.de"> | ||
| </div> | ||
| <div class="mb-3"> | ||
| <label for="pwInput" class="form-label">Password</label> | ||
| <input type="password" class="form-control" id="pwInput" value="*************"> | ||
| </div> | ||
| <div class="account__save"> | ||
| <button type="submit" class="btn">Save changes</button> | ||
| </div> | ||
| </form>--> | ||
| <br> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| <section class="standard-layout"> | ||
| <div> | ||
| <div class="account"> | ||
| <div> | ||
| <a href="{% url 'password_reset' %}"> | ||
| <button class="btn btn-primary btn-lg" | ||
| type="submit">{% trans "Reset Password" %}</button> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </main> | ||
| </section> | ||
| </main> | ||
| {% 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
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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| from django.urls import path | ||
|
|
||
| from .views import * | ||
| from .views import signup, change_password, user_info, activate, password_reset_request | ||
|
|
||
| urlpatterns = [ | ||
| path("signup/", signup, name="signup"), | ||
| path("change_password/", change_password, name="change_password"), | ||
| path("user_info/", user_info, name="user_info"), | ||
| path("activate/<uidb64>/<token>/", activate, name="activate"), | ||
| path("password_reset", password_reset_request, name="password_reset"), | ||
| ] |
Oops, something went wrong.
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.
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 had done this with mysql because for testing purposes I could not find a way to generate automatically the postgres DB, whereas it was easy with mysql
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.
Yes, but with #183 this fails now, because dependencies are not met. Do you need help to fix this? Shall I look into this or do you want to fix it?
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.
Side note, I think because of #194 sqlite is used anyways.
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 will try to fix this in #197
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.
@Bachibouzouk overtakes #197 now