panvol / pandemic-volunteers

❤️ Pandemic Volunteers | ⚠️ Help Wanted
https://pandemicvolunteers.org
MIT License
29 stars 7 forks source link

Volunteer form could not handle some erroneous values #24

Open hantuzun opened 4 years ago

hantuzun commented 4 years ago
Screen Shot 2020-04-02 at 05 40 14

This form has valid email according to the frontend (it's valid according to RPC). But has a wrong email according to the backend (it's practically wrong).

In this case, we used to propagate the error from the db to the frontend. But now it gives a 500 error, can't handling this. The issue probably originated in this commit: https://github.com/hantuzun/pandemic-volunteers/commit/9c9758aa595d0e5f4b6bfd35971cfce58e8c17e0 according to bisect.

It's 5:45AM, I'll have a look at it another time.

hantuzun commented 4 years ago

The error could be about the following rendering:

      flash.now.alert = '<i class="fas fa-exclamation-triangle mr-1"></i> Could not be saved'
      render :template => 'home/index' and return

not providing the required location variables for the form after we've refactored it.

Error screenshot:

Screen Shot 2020-04-07 at 03 59 35
jamestran201 commented 4 years ago

This may be due to a quirk of the simple_form gem: https://github.com/heartcombo/simple_form/issues/54

The fix could be to specify that this is a select element: https://github.com/heartcombo/simple_form/issues/54#issuecomment-5600234