From 28ba91b10a697e5c0b8f6822c1572030a634d60c Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 23 Sep 2020 09:22:54 +0200 Subject: [PATCH] prevent errors in case that overlay selection is not transmitted some web clients seem to totally obmit the overlay field instead of transmitting it empty --- www/maposmatic/forms.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/maposmatic/forms.py b/www/maposmatic/forms.py index 24ac8889..9e7c46a5 100644 --- a/www/maposmatic/forms.py +++ b/www/maposmatic/forms.py @@ -190,8 +190,11 @@ class MapRenderingJobForm(forms.ModelForm): layout = cleaned_data.get("layout") stylesheet = cleaned_data.get("stylesheet") overlay_array = [] - for overlay in cleaned_data.get("overlay"): - overlay_array.append(overlay) + try: + for overlay in cleaned_data.get("overlay"): + overlay_array.append(overlay) + except: + pass overlay = ",".join(overlay_array) if layout == '':