generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from mikerae/166-user-story-change-password
166 user story change password closes #166
- Loading branch information
Showing
17 changed files
with
380 additions
and
158 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -172,3 +172,17 @@ | |
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field | ||
|
||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" | ||
|
||
# Email Server | ||
|
||
if "DEVELOPMENT" in os.environ: | ||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" | ||
DEFAULT_FROM_EMAIL = "[email protected]" | ||
else: | ||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" | ||
EMAIL_USE_TLS = True | ||
EMAIL_PORT = 587 | ||
EMAIL_HOST = "smtp.gmail.com" | ||
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER") | ||
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASS") | ||
DEFAULT_FROM_EMAIL = os.environ.get("EMAIL_HOST_USER") |
This file contains 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,14 +1,28 @@ | ||
"""django_string_rota URL Configuration | ||
""" | ||
from django.contrib import admin | ||
from django.urls import path, include | ||
from django.urls import path, include, re_path | ||
from allauth.account.views import PasswordChangeView | ||
|
||
from string_rota.views import login | ||
|
||
|
||
class CustomPasswordChangeView(PasswordChangeView): | ||
"""Redirect url for successfull password change""" | ||
|
||
success_url = "/string_rota" | ||
|
||
|
||
urlpatterns = [ | ||
path("admin/", admin.site.urls, name="admin"), | ||
path("summernote/", include("django_summernote.urls")), | ||
path("string_rota/", include("string_rota.urls")), | ||
path("", login, name="login"), | ||
re_path( | ||
r"^accounts/password/change/$", | ||
CustomPasswordChangeView.as_view(), | ||
name="account_password_change", | ||
), | ||
path("accounts/", include("allauth.urls")), | ||
path("player_info/", include("player_info.urls")), | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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,7 +1,6 @@ | ||
{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name %}Hello from {{ site_name }}!{% endblocktrans %} | ||
{% load i18n %}{% autoescape off %}Hello from the RSNO String Rota Team! | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}! | ||
{{ site_domain }}{% endblocktrans %} | ||
Thank you for using the RSNO String Rota! | ||
{% endautoescape %} |
This file contains 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,31 +1,50 @@ | ||
{% extends "account/base.html" %} | ||
{% extends "string_rota/index.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% load crispy_forms_tags %} | ||
|
||
{% load account %} | ||
|
||
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} | ||
|
||
|
||
{% block content %} | ||
<h1>{% trans "Confirm E-mail Address" %}</h1> | ||
<div class="row"></div> | ||
<div class="col 12"> | ||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
{% if confirmation %} | ||
|
||
{% user_display confirmation.email_address.user as user_display %} | ||
|
||
{% if confirmation %} | ||
<div class=" pt-4 pb-2"> | ||
<h1 class="card-title text-center pb-0 fs-4">{% trans "Confirm Email" %}</h1> | ||
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a | ||
href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user | ||
{{ user_display }}.{% endblocktrans %}</p> | ||
</div> | ||
|
||
{% user_display confirmation.email_address.user as user_display %} | ||
|
||
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p> | ||
|
||
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}"> | ||
{% csrf_token %} | ||
<button type="submit">{% trans 'Confirm' %}</button> | ||
</form> | ||
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}"> | ||
{% csrf_token %} | ||
<div class="text-center"> | ||
<button class="btn btn-success" type="submit">{% trans 'Confirm' %}</button> | ||
</div> | ||
</form> | ||
|
||
{% else %} | ||
{% else %} | ||
|
||
{% url 'account_email' as email_url %} | ||
{% url 'account_email' as email_url %} | ||
|
||
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p> | ||
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a | ||
href="{{ email_url }}">issue a | ||
new e-mail confirmation request</a>.{% endblocktrans %}</p> | ||
|
||
{% endif %} | ||
{% endif %} | ||
|
||
{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains 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,29 +1,35 @@ | ||
{% extends "string_rota/index.html" %} | ||
{% extends "string_rota/home.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% block head_title %}{% trans "Sign Out" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
|
||
<div class="pt-4 pb-2"> | ||
<h5 class="card-title text-center pb-0 fs-4">{% trans "Sign Out" %}</h5> | ||
<p class="text-center small">{% trans 'Are you sure you want to sign out?' %}</p> | ||
</div> | ||
|
||
<form method="post" action="{% url 'account_logout' %}"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<main id="main" class="main"> | ||
<div class="row"></div> | ||
<div class="col-lg-4"> | ||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
|
||
<div class=" pt-4 pb-2"> | ||
<h1 class="card-title text-center pb-0 fs-4">{% trans "Sign Out" %}</h1> | ||
<p class="text-center small">{% trans 'Are you sure you want to sign out?' %}</p> | ||
</div> | ||
|
||
<form method="post" action="{% url 'account_logout' %}"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
{% if redirect_field_value %} | ||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"> | ||
{% endif %} | ||
<button class="btn btn-primary w-100" type="submit">{% trans 'Sign Out' %}</button> | ||
</form> | ||
|
||
<input type="hidden" name="redirect_field_name" value="{{ redirect_field_value }}"> | ||
{% endif %} | ||
<div class="text-center"> | ||
<button class="btn btn-primary" type="submit">{% trans 'Sign Out' %}</button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</main> | ||
{% endblock %} |
Oops, something went wrong.