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 event creation without physical location #3247

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

Conversation

MizukiTemma
Copy link
Member

Short description

This PR fixes the problem that events cannot be created without POI even if "Event does not have a physical location" is checked.

Proposed changes

  • Clean the POI id before passing the user input values into the form.: the cause was "-1", which is passed as POI id if no POI is selected but causes validation error, resulting in the form is judged as invalid (before reaching clean method).
  • Add a test for this case

Side effects

  • I hope none 🙈

Resolved issues

Fixes: #3223


Pull Request Review Guidelines

Copy link
Contributor

@lunars97 lunars97 left a comment

Choose a reason for hiding this comment

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

Everything looks good and works as expected! Thank you for fixing it 💛

Copy link
Member

@david-venhoff david-venhoff left a comment

Choose a reason for hiding this comment

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

Thanks, also for the tests!

Looks like the bug is that an element can not be found anymore. I get this console error when I click the "has not location" checkbox:
image

The commit that introduced this bug is 6fb7122

There, the id field for the input was probably accidentally removed, which means that the js code that controls it cannot find it anymore.

The fix is to add this to _poi_address_container.html line 7:

id="id_location

Then we don't need this extra code on the python side :)

(For reference, what the js code does is that it adds the disabled attribute to the location input, which means that it will not be part of the form data when the form is submitted, and that means that the python code does not receive the -1 value at all)

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.

Event creation not working when 'no physical location' checkbox is selected
3 participants