diff options
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/forms.py | 6 | ||||
-rw-r--r-- | archaeological_operations/utils.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 4a7d56024..24b0a70be 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -62,7 +62,7 @@ class ParcelField(forms.MultiValueField): self.widget = ParcelWidget() return super(ParcelField, self).__init__(*args, **kwargs) - def compress(data_list): + def compress(self, data_list): return u"-".join(data_list) @@ -73,7 +73,7 @@ class ParcelForm(forms.Form): town = forms.ChoiceField(label=_("Town"), choices=(), required=False, validators=[valid_id(models.Town)]) year = forms.IntegerField(label=_("Year"), required=False, - validators=[validators.MinValueValidator(1600), + validators=[validators.MinValueValidator(1000), validators.MaxValueValidator(2100)]) section = forms.CharField(label=_(u"Section"), required=False, validators=[validators.MaxLengthValidator(4)]) @@ -784,7 +784,7 @@ class OperationFormGeneral(ManageOldType, forms.Form): choices=[]) year = forms.IntegerField(label=_(u"Year"), initial=lambda: datetime.datetime.now().year, - validators=[validators.MinValueValidator(1600), + validators=[validators.MinValueValidator(1000), validators.MaxValueValidator(2100)]) old_code = forms.CharField( label=_(u"Old code"), required=False, diff --git a/archaeological_operations/utils.py b/archaeological_operations/utils.py index 40ca71c05..3a5057cd5 100644 --- a/archaeological_operations/utils.py +++ b/archaeological_operations/utils.py @@ -256,7 +256,7 @@ def parse_year(value): yr = int(value) except ValueError: return None - if yr < 1600 or yr > 2100: + if yr < 1000 or yr > 2100: return None return yr @@ -268,7 +268,7 @@ def parse_trunc_patriarche(value): value = value.replace(' ', '') try: int(value) - except: + except ValueError: return return '18' + unicode(value) |