Not so atomic, sorry

This commit is contained in:
Alexandre Iooss 2019-07-16 12:43:23 +02:00
parent ab616b3f64
commit fbe2e7f59a
No known key found for this signature in database
GPG key ID: 6C79278F3FCDCC02
30 changed files with 885 additions and 332 deletions

View file

@ -1,17 +0,0 @@
# -*- 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