Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[geo] Restrict to points only #151 #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[geo] Restrict to points only #151 #175

wants to merge 1 commit into from

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
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