From d7b838f3c088337248c0c94d9b765b68e30551a8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 12 May 2014 17:56:38 +0200 Subject: Add email field to organizations - Django management of email fields (refs #1677) --- ishtar_common/forms_common.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 790a128c7..0bea551cf 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -82,6 +82,7 @@ class OrganizationForm(forms.Form): town = forms.CharField(label=_(u"Town"), max_length=30, required=False) country = forms.CharField(label=_(u"Country"), max_length=30, required=False) + email = forms.EmailField(label=_(u"Email"), required=False) phone = forms.CharField(label=_(u"Phone"), max_length=18, required=False) mobile_phone = forms.CharField(label=_(u"Town"), max_length=18, required=False) @@ -123,7 +124,7 @@ class OrganizationFormSelection(forms.Form): class PersonSelect(TableSelect): name = forms.CharField(label=_(u"Name"), max_length=30) surname = forms.CharField(label=_(u"Surname"), max_length=20) - email = forms.CharField(label=_(u"Email"), max_length=40) + email = forms.CharField(label=_(u"Email"), max_length=75) person_types = forms.ChoiceField(label=_(u"Type"), choices=[]) attached_to = forms.IntegerField(label=_("Organization"), widget=widgets.JQueryAutoComplete( @@ -161,8 +162,10 @@ class SimplePersonForm(forms.Form): town = forms.CharField(label=_(u"Town"), max_length=30, required=False) country = forms.CharField(label=_(u"Country"), max_length=30, required=False) - email = forms.CharField(label=_(u"Email"), max_length=40, required=False, - validators=[validators.validate_email]) + email = forms.EmailField(label=_(u"Email"), required=False) + phone = forms.CharField(label=_(u"Phone"), max_length=18, required=False) + mobile_phone = forms.CharField(label=_(u"Town"), max_length=18, + required=False) attached_to = forms.IntegerField(label=_("Current organization"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-organization'), -- cgit v1.2.3