Projet

Général

Profil

0001-auth-let-LoginPassword-frontend-handle-registration-.patch

Serghei Mihai, 15 avril 2019 17:59

Télécharger (2,26 ko)

Voir les différences:

Subject: [PATCH] auth: let LoginPassword frontend handle registration (#31218)

 src/authentic2/authenticators.py                           | 4 ++++
 .../registration/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/registration/login_password_registration_form.html
src/authentic2/authenticators.py
44 44

  
45 45
    def profile(self, request, *args, **kwargs):
46 46
        return views.login_password_profile(request, *args, **kwargs)
47

  
48
    def registration(self, request, *args, **kwargs):
49
        context = kwargs.get('context', {})
50
        return render(request, 'registration/login_password_registration_form.html', context)
src/authentic2/templates/registration/login_password_registration_form.html
1
{% load i18n %}
2

  
3
<form enctype="multipart/form-data" method="post">
4
  {% csrf_token %}
5
  {{ form.as_p }}
6
  <button class="submit-button">{% trans 'Submit' %}</button>
7
</form>
src/authentic2/templates/registration/registration_form.html
15 15

  
16 16
<h2>{{ view.title }}</h2>
17 17

  
18
<form enctype="multipart/form-data" method="post">
19

  
20
  {% csrf_token %}
21
  {{ form.as_p }}
22
  <button class="submit-button">{% trans 'Submit' %}</button>
23
</form>
24

  
25 18
{% for id, block in frontends.items %}
26 19
  <div class="registration_frontend">
27 20
    <h2>{{ block.name }}</h2>
28
-