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

Disabling amount can result in integer validation errors #180

Closed
stewartadam opened this issue Sep 21, 2020 · 3 comments
Closed

Disabling amount can result in integer validation errors #180

stewartadam opened this issue Sep 21, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@stewartadam
Copy link
Contributor

Version

Please provide your current version (can be found on the system page since v0.8.4)
Version: 0.10.1

Bug description

A clear and concise description of what the bug is.

When adding/editing a recipe, selecting "Disable Amount" sometimes results in a validation error upon saving the recipe:
image

I believe this happens if the quantity/unit fields were focused before selecting disable amount. Filling the quantity field with any integer value then disabling amount again for that ingredient works.

@vabene1111 vabene1111 added the bug Something isn't working label Sep 21, 2020
@vabene1111
Copy link
Collaborator

I have tried to reproduce this issue but i can only do so by purposely typing some letters into the amount field (which i guess makes the error valid). Can you try to investigate this further and see which normal behavior is causing this issue ?

One option would be to just always set the amount to 0 whenever the amount is disabled. I didn't want to to this because if you have a amount entered and then disable it (possibly by accident) you loose the data stored there before.

@stewartadam
Copy link
Contributor Author

stewartadam commented Sep 21, 2020

I double checked and it happens if I clear the field before disabling amount. Easy fix would be to coerce '' or None to 0.

@vabene1111
Copy link
Collaborator

ah ok, thank you, that can definitely cause it. Will see how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants