diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-30 17:26:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-30 17:26:44 +0200 |
commit | ffd57727a66952e12b5236e7567f5fd75eb7e5f8 (patch) | |
tree | 2b8ab152e92a95948e9a038ebcef815bfd56aa38 /archaeological_operations/forms.py | |
parent | 2a0842c8ffb0e7eec6b350f9d170670c8376cce8 (diff) | |
parent | 18995ac80a961083ad986f4abe984fd649ec40e2 (diff) | |
download | Ishtar-ffd57727a66952e12b5236e7567f5fd75eb7e5f8.tar.bz2 Ishtar-ffd57727a66952e12b5236e7567f5fd75eb7e5f8.zip |
Merge branch 'master' into develop
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 32b37e4c3..529a0c2fb 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -416,7 +416,9 @@ class RecordRelationsForm(ManageOldType, forms.Form): cleaned_data.get('right_record', None)): raise forms.ValidationError( _(u"You should select a relation type.")) - if str(cleaned_data.get('right_record')) == str(self.left_record.pk): + if self.left_record and \ + str(cleaned_data.get('right_record')) == str( + self.left_record.pk): raise forms.ValidationError( _(u"An operation cannot be related to herself.")) return cleaned_data @@ -481,7 +483,8 @@ class OperationSelect(TableSelect): year = forms.IntegerField(label=_("Year")) operation_code = forms.IntegerField(label=_(u"Numeric reference")) if settings.COUNTRY == 'fr': - code_patriarche = forms.IntegerField( + code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") towns = get_town_field() @@ -769,9 +772,10 @@ class OperationFormGeneral(ManageOldType, forms.Form): } pk = forms.IntegerField(required=False, widget=forms.HiddenInput) if settings.COUNTRY == 'fr': - code_patriarche = forms.IntegerField(label=u"Code PATRIARCHE", - widget=OAWidget, - required=False) + code_patriarche = forms.CharField(label=u"Code PATRIARCHE", + max_length=500, + widget=OAWidget, + required=False) common_name = forms.CharField(label=_(u"Generic name"), required=False, max_length=500, widget=forms.Textarea) address = forms.CharField(label=_(u"Address / Locality"), required=False, @@ -934,7 +938,7 @@ class OperationFormGeneral(ManageOldType, forms.Form): if 'pk' in cleaned_data and cleaned_data['pk']: ops = ops.exclude(pk=cleaned_data['pk']) if ops.count(): - msg = u"Ce code Patriarche a déjà été affecté à une "\ + msg = u"Ce code OA a déjà été affecté à une "\ u"autre opération" raise forms.ValidationError(msg) # manage unique operation ID @@ -1280,7 +1284,8 @@ class OperationSourceSelect(SourceSelect): operation__operation_code = forms.IntegerField( label=_(u"Numeric reference")) if settings.COUNTRY == 'fr': - operation__code_patriarche = forms.IntegerField( + operation__code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") operation__towns = get_town_field(label=_(u"Operation's town")) @@ -1312,7 +1317,8 @@ class AdministrativeActOpeSelect(TableSelect): if settings.COUNTRY == 'fr': ref_sra = forms.CharField(label=u"Autre référence", max_length=15) - operation__code_patriarche = forms.IntegerField( + operation__code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") act_type = forms.ChoiceField(label=_("Act type"), choices=[]) |