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

Fix for issue #20 #22

Closed
mjnaylor8 opened this issue Dec 4, 2020 · 4 comments
Closed

Fix for issue #20 #22

mjnaylor8 opened this issue Dec 4, 2020 · 4 comments

Comments

@mjnaylor8
Copy link

mjnaylor8 commented Dec 4, 2020

Hi I left a comment in issue #20 but in case you don't see that ....

Issue can be fixed my moving one line of code in the init of the SpatialLocationField in forms.py. I suspect this might also be the case if you are using Location Field.

So move the line
self.widget = MapInput(map_attrs=map_attrs, )

below the
super().init(*args, **kwargs)

so the def init is now ....

def __init__(self, *args, **kwargs):
    map_attrs = kwargs.pop("map_attrs", None)

    super().__init__(*args, **kwargs)
    self.widget = MapInput(map_attrs=map_attrs, )
    self.error_messages = {"required": "Please pick a location, it's required", }
@simon-the-shark
Copy link
Owner

Hi! That's a solution to this problem. Nice job! I will include your fix in next release as soon as possible. You can also make a pull request next time.

@mjnaylor8
Copy link
Author

mjnaylor8 commented Dec 4, 2020 via email

@simon-the-shark
Copy link
Owner

I've included your fix in v1.7.0. Already available on pypi

@simon-the-shark
Copy link
Owner

Once you're ready, make a pull request and I'll be happy to review your changes. Looking forward to it. Good luck!

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

No branches or pull requests

2 participants