fixed linting errors
This commit is contained in:
parent
ecc80b939d
commit
4ab42bf3de
4 changed files with 12 additions and 11 deletions
|
|
@ -2,6 +2,7 @@ from django import forms
|
||||||
from django.contrib.auth.forms import UserCreationForm
|
from django.contrib.auth.forms import UserCreationForm
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
class RegistrationForm(UserCreationForm):
|
class RegistrationForm(UserCreationForm):
|
||||||
email = forms.EmailField(label="Email", widget=forms.TextInput(), required=True)
|
email = forms.EmailField(label="Email", widget=forms.TextInput(), required=True)
|
||||||
first_name = forms.CharField(label="Prénom", widget=forms.TextInput(), required=True)
|
first_name = forms.CharField(label="Prénom", widget=forms.TextInput(), required=True)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Création d'utilisateur</h1>
|
<h1>Création d'utilisateur</h1>
|
||||||
<form action = '' method="post">{% csrf_token %}
|
<form action="" method="post">{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{{ form.as_p }}
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" value="Envoyer">
|
<input type="submit" value="Envoyer">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import signup
|
from .views import signup
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', signup, name='signup'),
|
path('', signup, name='signup'),
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
from django import forms
|
|
||||||
from django.contrib.auth import login
|
from django.contrib.auth import login
|
||||||
from django.http.response import HttpResponse
|
|
||||||
|
|
||||||
|
|
||||||
from django.shortcuts import redirect, render
|
from django.shortcuts import redirect, render
|
||||||
|
|
||||||
from .forms import RegistrationForm
|
from .forms import RegistrationForm
|
||||||
|
|
||||||
|
|
||||||
def signup(request):
|
def signup(request):
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = RegistrationForm(request.POST)
|
form = RegistrationForm(request.POST)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue