-
-
- {{ field|addcss:'input' }}
- {% if field.help_text %}
-
{{ field.help_text }}
- {% endif %}
- {% for error in field.errors %}
-
{{ error }}
- {% endfor %}
-
+ {% for field in form %}
+
+
+
+ {{ field|addcss:'input' }}
+ {% if field.help_text %}
+
{{ field.help_text }}
+ {% endif %}
+ {% for error in field.errors %}
+
{{ error }}
+ {% endfor %}
+
- {% endfor %}
+ {% endfor %}
-
+
diff --git a/app/authentification/templatetags/utils_templating.py b/app/authentification/templatetags/utils_templating.py
index bd747cba..ced2894d 100644
--- a/app/authentification/templatetags/utils_templating.py
+++ b/app/authentification/templatetags/utils_templating.py
@@ -2,6 +2,7 @@ from django import template
register = template.Library()
+
@register.filter(name='addcss')
def addcss(value, arg):
css_classes = value.field.widget.attrs.get('class', '').split(' ')
diff --git a/app/authentification/tokens.py b/app/authentification/tokens.py
index ad5ab594..e8b35d21 100644
--- a/app/authentification/tokens.py
+++ b/app/authentification/tokens.py
@@ -1,9 +1,13 @@
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils import six
+
+
class TokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
return (
six.text_type(user.pk) + six.text_type(timestamp) +
six.text_type(user.is_active)
)
+
+
account_activation_token = TokenGenerator()
diff --git a/app/authentification/urls.py b/app/authentification/urls.py
index 11717dff..51d1a809 100644
--- a/app/authentification/urls.py
+++ b/app/authentification/urls.py
@@ -1,14 +1,17 @@
from django.urls import path
from django.contrib.auth.views import PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
-from .views import SignupView
-from .utils import activate
+from .views import SignupView
+from .utils import activate
urlpatterns = [
- path('password_reset/done/', PasswordResetDoneView.as_view(),name='password_reset_done'),
- path('reset/done/', PasswordResetCompleteView.as_view(),name='password_reset_complete'),
- path('reset///', PasswordResetConfirmView.as_view(),name='password_reset_confirm'),
+ path('password_reset/done/', PasswordResetDoneView.as_view(),
+ name='password_reset_done'),
+ path('reset/done/', PasswordResetCompleteView.as_view(),
+ name='password_reset_complete'),
+ path('reset///', PasswordResetConfirmView.as_view(),
+ name='password_reset_confirm'),
path('signup/', SignupView.as_view(), name='signup'),
path('activate//', activate, name='activate'),
]
diff --git a/app/authentification/utils.py b/app/authentification/utils.py
index 3c9856fe..deba90f4 100644
--- a/app/authentification/utils.py
+++ b/app/authentification/utils.py
@@ -6,6 +6,7 @@ from django.utils.http import urlsafe_base64_decode
from .tokens import account_activation_token
from django.contrib.auth.models import User
+
def activate(request, uidb64, token):
try:
uid = force_text(urlsafe_base64_decode(uidb64))
@@ -15,7 +16,8 @@ def activate(request, uidb64, token):
if user is not None and account_activation_token.check_token(user, token):
user.is_active = True
user.save()
- login(request=request, user=user, backend='django.contrib.auth.backends.ModelBackend')
+ login(request=request, user=user,
+ backend='django.contrib.auth.backends.ModelBackend')
return redirect('projects')
else:
return render(request, 'validate_mail_address_invalid.html')
diff --git a/app/authentification/views.py b/app/authentification/views.py
index 24b0fe60..7b01a693 100644
--- a/app/authentification/views.py
+++ b/app/authentification/views.py
@@ -10,6 +10,7 @@ from django.views.generic import TemplateView
from app import settings
+
class SignupView(TemplateView):
template_name = 'signup.html'
form_class = SignupForm
@@ -35,12 +36,12 @@ class SignupView(TemplateView):
message = render_to_string('acc_active_email.html', {
'user': user,
'domain': current_site.domain,
- 'uid':urlsafe_base64_encode(force_bytes(user.pk)).decode(),
- 'token':account_activation_token.make_token(user),
+ 'uid': urlsafe_base64_encode(force_bytes(user.pk)).decode(),
+ 'token': account_activation_token.make_token(user),
})
to_email = form.cleaned_data.get('email')
email = EmailMessage(
- mail_subject, message, to=[to_email]
+ mail_subject, message, to=[to_email]
)
email.send()
return render(request, 'validate_mail_address_complete.html')
diff --git a/app/server/views.py b/app/server/views.py
index 8d520ccc..785e8c79 100644
--- a/app/server/views.py
+++ b/app/server/views.py
@@ -90,7 +90,7 @@ class LoginView(BaseLoginView):
extra_context = {
'github_login': bool(settings.SOCIAL_AUTH_GITHUB_KEY),
'aad_login': bool(settings.SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID),
- 'allow_signup' : bool(settings.ALLOW_SIGNUP),
+ 'allow_signup': bool(settings.ALLOW_SIGNUP),
}
def get_context_data(self, **kwargs):