From c80246d032b505bf75c073a751fe9e9957fe7359 Mon Sep 17 00:00:00 2001 From: Raz Date: Tue, 4 Feb 2025 19:07:01 +0100 Subject: [PATCH] add signup success view --- padelclub_backend/settings.py | 16 ++------------ .../registration/signup_success.html | 22 +++++++++++++++++++ tournaments/views.py | 5 +++-- 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 tournaments/templates/registration/signup_success.html diff --git a/padelclub_backend/settings.py b/padelclub_backend/settings.py index 5106803..2c5c17e 100644 --- a/padelclub_backend/settings.py +++ b/padelclub_backend/settings.py @@ -142,15 +142,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/') DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -CSRF_TRUSTED_ORIGINS = [ - 'http://127.0.0.1:8000', - 'https://padelclub.app', - 'http://padelclub.app' -] # Ajoutez vos domaines de confiance - -from .settings_local import * -from .settings_app import * - # settings.py LOGIN_REDIRECT_URL = '/' # Redirect to the homepage after login LOGOUT_REDIRECT_URL = '/' # Redirect to the homepage after logout @@ -160,8 +151,5 @@ AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', ] -CSRF_COOKIE_SECURE = True # if using HTTPS -CSRF_COOKIE_HTTPONLY = False # needed for AJAX requests -CSRF_USE_SESSIONS = False # store CSRF token in cookie instead of session -CSRF_COOKIE_SAMESITE = 'Lax' # or 'Strict' for more security -LOGIN_URL = 'login' +from .settings_local import * +from .settings_app import * diff --git a/tournaments/templates/registration/signup_success.html b/tournaments/templates/registration/signup_success.html new file mode 100644 index 0000000..0e40cc7 --- /dev/null +++ b/tournaments/templates/registration/signup_success.html @@ -0,0 +1,22 @@ +{% extends 'tournaments/base.html' %} + +{% block head_title %} Création de compte {% endblock %} +{% block first_title %} Padel Club {% endblock %} +{% block second_title %} Création de compte {% endblock %} + +{% block content %} +{% load static %} +{% load tz %} + +
+
+ +
+ Veuillez vérifier votre e-mail pour confirmer votre compte. +
+
+ Continuer +
+
+
+{% endblock %} diff --git a/tournaments/views.py b/tournaments/views.py index add3598..6bdc5ca 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -634,8 +634,9 @@ def signup(request): send_verification_email(request, user, next_url) - messages.success(request, "Votre compte a été créé ! Veuillez vérifier votre e-mail pour confirmer votre compte.") - return redirect(next_url) + return render(request, 'registration/signup_success.html', { + 'next_url': next_url + }) else: form = SimpleCustomUserCreationForm()