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

maps: fix GeoJsonPointMixin with dict as input #1776

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

m4ra
Copy link
Contributor

@m4ra m4ra commented Feb 25, 2025

fixes liqd/a4-meinberlin#6150

Tasks

  • PR name contains story or task reference
  • Documentation (docs and inline)
  • Tests (including n+1 and django_assert_num_queries where applicable)
  • Changelog

@m4ra m4ra requested a review from goapunk February 25, 2025 16:22
if isinstance(geo_field, dict):
point = geo_field
else:
point = json.loads(geo_field)
data = data.copy()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@goapunk BTW why you make a copy here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought because data is immutable, but know I'm not totally sure any more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works without the copy too.

Copy link
Contributor

@goapunk goapunk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@goapunk goapunk merged commit 87561ed into main Feb 25, 2025
2 checks passed
@goapunk goapunk deleted the mk-2025-02-fix-geo-field-serializer branch February 25, 2025 16:57
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.

Kiezradar creation fails with JSON error due to the introduction of spatial field
2 participants