diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-14 00:06:50 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-14 00:06:50 +0200 |
| commit | 925d922c76979aab57acb2c704bf37214c081748 (patch) | |
| tree | 798e513566e218efcb149e02edcddd8617c6f64e /archaeological_operations/forms.py | |
| parent | 9b7629324fe6bfcf912259c31176da81a015559f (diff) | |
| parent | d8dbe942763ca621a6ae91ecfe70d1cd749e793f (diff) | |
| download | Ishtar-925d922c76979aab57acb2c704bf37214c081748.tar.bz2 Ishtar-925d922c76979aab57acb2c704bf37214c081748.zip | |
Merge branch 'master' into v0.9
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 8fd9233d2..058e637f4 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, @@ -932,7 +936,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 @@ -1271,7 +1275,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")) @@ -1303,7 +1308,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=[]) |
