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

Imports: Wrong row indicated in error messages #2325

Open
richardolsson opened this issue Nov 1, 2024 · 0 comments · May be fixed by #2339
Open

Imports: Wrong row indicated in error messages #2325

richardolsson opened this issue Nov 1, 2024 · 0 comments · May be fixed by #2339
Assignees
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐟 Small Should be a quick-ish fix.

Comments

@richardolsson
Copy link
Member

Description

Zetkin has a feature for importing people from Excel files or CSV files where every row is one person. When a user imports an Excel file or CSV, the file will often contain a first row which does not represent a person, but instead contain headers for the various columns. The importer can skip this row, and only generate people from the subsequent rows. However, when errors occur, the validation logic will report row numbers counted with the first row skipped. An error that occurs on the first person will be reported as "row 1", even though in the file it's on row 2 (because row 1 in the file is the header). The error message could be improved.

Steps to reproduce

  1. Go to https://app.dev.zetkin.org/organize/1/people
  2. Click on "Add"
  3. Click "Import people"
  4. Drag and drop the sample file onto the modal
  5. Make sure "First row contains headers" option is selected
  6. Configure the fields (first name, last name, email)
  7. Click "Validate"

Sample file

FIRST,LAST,EMAIL
Clara,Zetkin,123

Expected Behaviour

An error should be reported on line 2, i.e. the first person, whose email address is invalid.

Actual Behaviour

An error is reported, but for line 1, by which it means the first person.

Screenshots (if you have any)

None

Proposed solution

Add +1 to all line numbers when reported in an error, if the "First row is headers" option is selceted.

@richardolsson richardolsson added 🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐟 Small Should be a quick-ish fix. labels Nov 1, 2024
@niklasva82 niklasva82 self-assigned this Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐟 Small Should be a quick-ish fix.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants