Projet

Général

Profil

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

Serghei Mihai, 01 février 2019 16:43

Télécharger (2,29 ko)

Voir les différences:

Subject: [PATCH 1/2] auth: let LoginPassowrd frontend handle registration
 (#28215)

 src/authentic2/auth_frontends.py                       |  4 ++++
 .../registration/login_password_registration_form.html |  7 +++++++
 .../templates/registration/registration_form.html      | 10 ----------
 3 files changed, 11 insertions(+), 10 deletions(-)
 create mode 100644 src/authentic2/templates/registration/login_password_registration_form.html
src/authentic2/auth_frontends.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
12 12
{% endblock %}
13 13

  
14 14
{% block content %}
15

  
16
<h2>{{ view.title }}</h2>
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 15
{% for id, block in frontends.items %}
26 16
  <div class="registration_frontend">
27 17
    <h2>{{ block.name }}</h2>
28
-