From 4896d67675486d86807ced3ed04ab6665aefb990 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Fri, 1 Feb 2019 12:14:46 +0100 Subject: [PATCH] auth: let LoginPassword frontend handle registration (#31218) --- src/authentic2/authenticators.py | 4 ++++ .../authentic2/login_password_registration_form.html | 7 +++++++ .../templates/registration/registration_form.html | 7 ------- 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 src/authentic2/templates/authentic2/login_password_registration_form.html diff --git a/src/authentic2/authenticators.py b/src/authentic2/authenticators.py index 0944d7b6..f258621c 100644 --- a/src/authentic2/authenticators.py +++ b/src/authentic2/authenticators.py @@ -44,3 +44,7 @@ class LoginPasswordAuthenticator(object): def profile(self, request, *args, **kwargs): return views.login_password_profile(request, *args, **kwargs) + + def registration(self, request, *args, **kwargs): + context = kwargs.get('context', {}) + return render(request, 'authentic2/login_password_registration_form.html', context) diff --git a/src/authentic2/templates/authentic2/login_password_registration_form.html b/src/authentic2/templates/authentic2/login_password_registration_form.html new file mode 100644 index 00000000..b5ee9ecd --- /dev/null +++ b/src/authentic2/templates/authentic2/login_password_registration_form.html @@ -0,0 +1,7 @@ +{% load i18n %} + +
+ {% csrf_token %} + {{ form.as_p }} + +
diff --git a/src/authentic2/templates/registration/registration_form.html b/src/authentic2/templates/registration/registration_form.html index 68252c9b..01c7cdc7 100644 --- a/src/authentic2/templates/registration/registration_form.html +++ b/src/authentic2/templates/registration/registration_form.html @@ -15,13 +15,6 @@

{{ view.title }}

-
- - {% csrf_token %} - {{ form.as_p }} - -
- {% for id, block in frontends.items %}

{{ block.name }}

-- 2.20.1