Skip to content
Snippets Groups Projects
Commit dcd4b641 authored by Dorian Lesbre's avatar Dorian Lesbre
Browse files

Minor code cleanup

parent dbc4f4a6
No related branches found
No related tags found
No related merge requests found
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth import login, logout
from django.contrib.auth.views import LoginView as DjangoLoginView
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404
from django.utils.encoding import force_bytes, force_text
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.urls import reverse
from django.template.loader import render_to_string
......@@ -32,6 +31,7 @@ class LogoutView(RedirectView):
messages.info(self.request, "Vous avez bien été déconnecté·e.")
return super().get_redirect_url(*args, **kwargs)
class CreateAccountView(View):
"""Vue pour la creation de compte"""
form_class = CreateAccountForm
......@@ -78,8 +78,9 @@ class CreateAccountView(View):
return redirect('accounts:login')
class ActivateAccountView(RedirectView):
class ActivateAccountView(RedirectView):
"""Vue d'activation de compte (lien envoyé par mail)"""
permanent = False
def get_redirect_url(self, uidb64, token, *args, **kwargs):
......
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.shortcuts import redirect, render
from django.urls import reverse
......
......@@ -132,13 +132,8 @@ USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
LOGIN_REDIRECT_URL = 'home'
# Blocks account creation when false
REGISTRATION_USER_CREATION_OPEN = True
# Blocks event inscription
REGISTRATION_EVENT_INSCRIPTIONS_OPEN = True
LOGIN_URL = "accounts:login"
LOGIN_REDIRECT_URL = "home"
# This will display email in Console.
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment