2019-07-08 11:59:31 +00:00
|
|
|
# -*- 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
|
|
|
|
"""
|
2019-07-16 10:59:11 +00:00
|
|
|
|
2019-07-08 11:59:31 +00:00
|
|
|
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
|