1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48: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

@ -2,17 +2,13 @@
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from django.contrib.auth.models import User
from django import forms
from .models import Profile
class CustomUserChangeForm(UserChangeForm):
"""
Make first name, last name and email required
in the default Django Auth User model
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['first_name'].required = True
self.fields['last_name'].required = True
self.fields['email'].required = True
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
fields = '__all__'