From a713dd136a62f036c387085ef1da7b7698579ea8 Mon Sep 17 00:00:00 2001 From: Guillim Date: Tue, 9 Jul 2019 10:41:30 +0200 Subject: [PATCH] Following Hironsan review, did some change. --- app/app/settings.py | 2 +- app/authentification/forms.py | 3 ++- app/authentification/utils.py | 4 +++- docker-compose.yml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/app/settings.py b/app/app/settings.py index f93e543b..b5b16640 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -88,7 +88,7 @@ ROOT_URLCONF = 'app.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [path.join(BASE_DIR, 'server/templates'),path.join(BASE_DIR, 'authentification/templates')], + 'DIRS': [path.join(BASE_DIR, 'server/templates'), path.join(BASE_DIR, 'authentification/templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/app/authentification/forms.py b/app/authentification/forms.py index 19abc1f2..ad7a49f6 100644 --- a/app/authentification/forms.py +++ b/app/authentification/forms.py @@ -1,7 +1,8 @@ from django import forms from django.contrib.auth.forms import UserCreationForm -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model +User = get_user_model() class SignupForm(UserCreationForm): email = forms.EmailField(max_length=200, help_text='Required') diff --git a/app/authentification/utils.py b/app/authentification/utils.py index f6d10d40..3470f16d 100644 --- a/app/authentification/utils.py +++ b/app/authentification/utils.py @@ -4,7 +4,9 @@ from django.contrib.auth import login from django.utils.encoding import force_text from django.utils.http import urlsafe_base64_decode from .tokens import account_activation_token -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model + +User = get_user_model() def activate(request, uidb64, token): diff --git a/docker-compose.yml b/docker-compose.yml index 5ae6bc69..9b419489 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: ADMIN_PASSWORD: "password" ADMIN_EMAIL: "admin@example.com" DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable" - ALLOW_SIGNUP: "True" + ALLOW_SIGNUP: "False" ports: - 8000:8000