NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Fixed #561

Closed praveenphatate closed 1 year ago

praveenphatate commented 1 year ago

The GEOSGeometryerror was not actually being thrown in our code. Instead, it was called when trying to deserialize our unique N, S, E, W bounding box format when calling super().get_context(...).

https://github.com/django/django/blob/eba81c83906fd966204b9853aaa793f0516ccd4b/django/contrib/gis/forms/widgets.py#L40-L50

The solution is to ensure that value is cast to a GEOSGeometry before calling super().get_context(...).

Closes #432

edkeeble commented 1 year ago

FYI, we've merged a branch that refactored the code base significantly in order to support automated deployments. This mostly involved moving app-related files into an app directory. You will need to reconcile your changes here with the new folder structure before you can merge.

alukach commented 1 year ago

This PR added a union type (GEOSGeometry | str) which is written in a manner only available in Python 3.10+. This is fine as we are using Python 3.11 in prod: https://github.com/NASA-IMPACT/admg-backend/blob/d4441c0b583cc6dd59ed392f16143645858522c8/app/Dockerfile.prod#L2

However, a number of our CI steps were using older version of Python. I went through the painful process of updating those versions, which caused a number of odd issues. See https://github.com/actions/setup-python/issues/556 & https://github.com/actions/setup-python/issues/719. Nonetheless, I finally got this working by having the tests CI steps install into the user environment.