EPSG validation fix

pull/1086/head
Piero Toffanin 2021-11-05 16:00:27 -04:00
rodzic 69f80b320e
commit 35a13a1ba4
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -518,9 +518,6 @@ class Export(TaskNestedView):
except ValueError:
raise exceptions.ValidationError(_("Invalid EPSG code: %(value)s") % {'value': epsg})
if epsg is not None and task.epsg is None:
raise exceptions.ValidationError(_("Cannot use epsg on non-georeferenced dataset"))
if (formula and not bands) or (not formula and bands):
raise exceptions.ValidationError(_("Both formula and bands parameters are required"))
@ -559,6 +556,9 @@ class Export(TaskNestedView):
if not os.path.isfile(url):
raise exceptions.NotFound()
if epsg is not None and task.epsg is None:
raise exceptions.ValidationError(_("Cannot use epsg on non-georeferenced dataset"))
# Strip unsafe chars, append suffix
extension = extension_for_export_format(export_format)