Skip to content

Show field names in bulk upload error file (#2534)#2780

Open
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/2534-bulk-upload-error-fields
Open

Show field names in bulk upload error file (#2534)#2780
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/2534-bulk-upload-error-fields

Conversation

@Tarekchehahde

Copy link
Copy Markdown

Summary

  • Map non_field_errors to a General Error column in the exported error xlsx
  • Map internal location validation failures to Latitude and Longitude error columns
  • Raise field-keyed validation errors in LocalUnitBulkUploadDetailSerializer for missing branch names and coordinates (instead of plain-string errors with no column)
  • Add local_units/test_bulk_upload_errors.py covering ErrorWriter column mapping

Closes #2534

Context

ErrorWriter already added per-field _error columns, but many serializer failures used string ValidationError messages or internal keys (location, non_field_errors) that did not line up with spreadsheet headers.

Test plan

  • Code review of ErrorWriter column mapping logic
  • docker-compose run --rm test pytest local_units/test_bulk_upload_errors.py (requires project docker env + GDAL)
  • Manual bulk upload with invalid lat/long and confirm Latitude_error / Longitude_error columns in error file

Made with Cursor

Map validation errors to spreadsheet column labels: non_field_errors become
General Error, location errors attach to Latitude/Longitude, and serializer
validate() now raises field-keyed errors for branch names and coordinates.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Error message field on error file of bulk upload

1 participant