2020-04-18 13:02:41 +00:00
|
|
|
from django.forms import ModelForm, CharField, BooleanField, ImageField
|
2020-04-16 13:22:03 +00:00
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
2020-04-18 13:02:41 +00:00
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
|
|
|
|
from phonenumber_field.formfields import PhoneNumberField
|
2020-04-16 13:22:03 +00:00
|
|
|
|
|
|
|
from core.models import AdminProfile
|
|
|
|
|
|
|
|
class AdminEditForm(ModelForm):
|
2020-04-18 13:02:41 +00:00
|
|
|
display_name = CharField(required=False, label=_('Internal Display Name'))
|
|
|
|
mobile = PhoneNumberField(required=False, label=_('Mobile Number'))
|
|
|
|
role = CharField(required=False, label=_("Role"))
|
|
|
|
image = ImageField(required=False, label=_("Image"))
|
|
|
|
remove_image = BooleanField(required=False, label=_("Remove image from profile?"))
|
2020-04-16 13:22:03 +00:00
|
|
|
|
|
|
|
class Meta:
|
2020-04-18 13:02:41 +00:00
|
|
|
model = get_user_model()
|
|
|
|
fields = ('first_name', 'last_name', "display_name", "email", 'mobile', "role", "image", "remove_image")
|