1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

add signup view

This commit is contained in:
Pierre-antoine Comby
2019-08-11 16:22:52 +02:00
parent fbc6570eb6
commit 633663f95d
7 changed files with 74 additions and 17 deletions

View File

@ -7,4 +7,23 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.translation import gettext_lazy as _
from django.views.generic.edit import CreateView
from .models import
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse_lazy
from .models import Profile
from .forms import ProfileForm
class SignUp(CreateView):
"""
Une vue pour inscrire un utilisateur et lui créer un profile
"""
form_class = ProfileForm
success_url = reverse_lazy('login')
template_name ='member/signup.html'
second_form = UserCreationForm
def get_context_data(self,**kwargs):
context = super(SignUp,self).get_context_data(**kwargs)
context["user_form"] = self.second_form
return context