Openfoodnetwork: Invalid unit_value on product creation returns 500 instead of 422

Created on 1 Oct 2020  路  4Comments  路  Source: openfoodfoundation/openfoodnetwork

Description

Entering a non-number for unit_value (appears as the "Value" text field) during product creation returns a 500 error instead of a more informative error message. We do have placeholder text in the field but this can often be missed or misinterpreted.

Expected Behavior

Error message stating "Value must be a number" and a 422 server response.

Actual Behaviour

Entering a non-number for unit_value during product creation returns a 500 error.

Steps to Reproduce

  1. https://openfoodnetwork.net/admin/products
  2. Click on New Product
  3. Enter valid product information except for the Value text field
  4. Click Create
  5. Death by slug

Animated Gif/Screenshot

Screen Shot 2020-10-01 at 1 53 41 PM

Workaround

Reading the placeholder text, or just guessing at what went wrong.

Severity

bug-s4: it's annoying, but you can use it

Your Environment

Safari

Possible Fix

bug-s4 good first issue hackathon

All 4 comments

@andrewpbrett thanks :) When you add a good first issue, don't hesitate to add it to the welcome new dev board (it's a project) and add it to the correct column.Also, in this month of hacktoberfest, don't hesitate to use the hacktoberfest label 馃挭

Hello @andrewpbrett

I am sure I can help you solve this issue. Can you please assign this issue to me if no one take this issue?

Thanks!

3912 and #4959 look very closely related and can probably be closed at the same time if we fix this one.

Hello @andrewpbrett

I will look into it.

Was this page helpful?
0 / 5 - 0 ratings