-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Display errors taking place during import partner process #4707
Display errors taking place during import partner process #4707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick thing I notice from your screenshot is that the errors are being displayed as a notice. Please display them as an error instead.
Thanks for catching that @cielf! It's been changed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for the partner import.
It's pointing out that we need to do some work on the donation site import -- because it is also not informing of errors. But/and we should expand that to cover more fields, so I think it can be a separate issue.
Passing to @dorner for technical review. |
All good, thanks! |
@jp524: Your PR |
Resolves #4688
Description
In order to display a message when a partner import is failing I modified the existing
Importable
concern and the Partner modelimport_csv
method. This ensures that any validation error (invalid email, name already taken, etc.) gets passed along to be displayed.The message shown to the user is more specific than the one asked in the issue, but I think it makes sense to display the exact error to the user in order for them to easily fix it.
On a technical note: I chose to modify all
import_csv
methods to return nil if there's no error, or otherwise return an errors array. I'm open to suggestions if there's a better way to do this.Type of change
How Has This Been Tested?
Added some requests tests for Partners, and ensured that tests for other models using
import_csv
(DonationSites, StorageLocation, ProductDriveParticipants, Vendors) were still passing.Screenshots
Successful import
Import with errors