Skip to content

Conversation

NoumbissiValere
Copy link
Contributor

Fixed the issue by adding a clean method
to the location model. This method
ensures that when the geometry is not
None, it should be an instance of a Point
Geometry else a ValidationError is raised

Fixed #151

@NoumbissiValere
Copy link
Contributor Author

@nemesisdesign Please can review this?
Thanks

Fixed the issue by adding a clean method
to the location model. This method
ensures that when the geometry is not
None, it should be an instance of a Point
Geometry else a ValidationError is raised

Fixes #151
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.722% when pulling 78a49f6 on NoumbissiValere:only_points into 667419b on openwisp:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.722% when pulling 78a49f6 on NoumbissiValere:only_points into 667419b on openwisp:master.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, the reason I left this open was that I thought we should prevent the user from entering other type of geometries in the admin. Maybe we can do that by overriding the widget in a way that forces it to use the widget for point, look for geom_type here: https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/forms/widgets.py

Do you think you can do that?

@NoumbissiValere
Copy link
Contributor Author

😄 I can have a look at it

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to be rebased on the current master

@NoumbissiValere NoumbissiValere self-assigned this Sep 10, 2020
@nemesifier nemesifier force-pushed the master branch 2 times, most recently from 0a1c550 to bbe0dab Compare October 25, 2020 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[geo] Restrict to points only
3 participants