mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:31:08 -05:00
fix error handling
This commit is contained in:
@@ -169,8 +169,8 @@ class ParkForm(forms.ModelForm):
|
||||
|
||||
# Convert to string to preserve exact decimal places
|
||||
return str(latitude)
|
||||
except (InvalidOperation, TypeError):
|
||||
raise forms.ValidationError("Invalid latitude value.")
|
||||
except (InvalidOperation, TypeError) as e:
|
||||
raise forms.ValidationError("Invalid latitude value.") from e
|
||||
return latitude
|
||||
|
||||
def clean_longitude(self):
|
||||
@@ -188,8 +188,8 @@ class ParkForm(forms.ModelForm):
|
||||
|
||||
# Convert to string to preserve exact decimal places
|
||||
return str(longitude)
|
||||
except (InvalidOperation, TypeError):
|
||||
raise forms.ValidationError("Invalid longitude value.")
|
||||
except (InvalidOperation, TypeError) as e:
|
||||
raise forms.ValidationError("Invalid longitude value.") from e
|
||||
return longitude
|
||||
|
||||
def save(self, commit=True):
|
||||
|
||||
Reference in New Issue
Block a user