diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-19 19:20:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-19 19:20:30 +0200 |
commit | 5a125c7b742130fb8dd87543fb42e8ffb9203762 (patch) | |
tree | 9411bd0657c9d483a838903f1c0e6539f979dede /chimere/forms.py | |
parent | 8205946e5dc30242ea085237c10fdddd197499c3 (diff) | |
download | Chimère-5a125c7b742130fb8dd87543fb42e8ffb9203762.tar.bz2 Chimère-5a125c7b742130fb8dd87543fb42e8ffb9203762.zip |
Use overpass API for OSM imports
Diffstat (limited to 'chimere/forms.py')
-rw-r--r-- | chimere/forms.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/chimere/forms.py b/chimere/forms.py index 1af454b..1178c81 100644 --- a/chimere/forms.py +++ b/chimere/forms.py @@ -204,7 +204,6 @@ class NewsAdminForm(forms.ModelForm): class ImporterAdminForm(forms.ModelForm): - filtr = forms.CharField(widget=ImportFiltrWidget, required=False) importer_type = forms.ChoiceField( widget=ImporterChoicesWidget, choices=[('', '--')] + list(IMPORTER_CHOICES)) @@ -224,16 +223,6 @@ class ImporterAdminForm(forms.ModelForm): Verify that only one type of source is provided Verify that shapefiles are zipped """ - if self.cleaned_data.get('importer_type') == 'OSM' and \ - not self.cleaned_data.get('filtr'): - raise forms.ValidationError( - _("For OSM import you must be provide a filter. Select an " - "area and node/way filter.")) - if self.cleaned_data.get('importer_type') == 'OSM' and \ - not RE_XAPI.match(self.cleaned_data.get('filtr')): - raise forms.ValidationError( - _("For OSM import you must be provide a filter. Select an " - "area and node/way filter.")) if self.cleaned_data.get('importer_type') == 'SHP' and \ not self.cleaned_data.get('zipped'): raise forms.ValidationError(_("Shapefiles must be provided in a " @@ -244,8 +233,7 @@ class ImporterAdminForm(forms.ModelForm): raise forms.ValidationError(_("You have to set \"source\" or " "\"source file\" but not both.")) if not self.cleaned_data.get('source') and \ - not self.cleaned_data.get('source_file') and \ - self.cleaned_data.get('importer_type') != 'OSM': + not self.cleaned_data.get('source_file'): raise forms.ValidationError(_("You have to set \"source\" or " "\"source file\".")) return self.cleaned_data |