1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-29 04:40:55 +02:00

Adherent admin

This commit is contained in:
Alexandre Iooss
2019-07-08 13:59:31 +02:00
parent 6ec6f96b41
commit c32dab80f8
5 changed files with 69 additions and 1 deletions

17
adherents/forms.py Normal file
View File

@ -0,0 +1,17 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.forms import UserChangeForm
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