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

fix: allow headers to be capitalized TASK-1174 #332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rgraber
Copy link

@rgraber rgraber commented Jan 30, 2025

Summary

Allow capitalization of the 'label' and 'name' headers in an xls upload.

Notes

When an XLSForm is uploaded with capital letters in the label or name headers, interpret it the same as their lowercase counterparts. This fixes a ValueError on deploy, which was happening because the import didn't recognize the label column as one that doesn't expect translations.

Preview

Note: when switching between main and this branch in the formpack code, make sure to run pip-compile and pip install again.

  1. clone this repo into your local copy of kpi
  2. update kpi's requirements.in to use -e /container/path/to/kpi/formpack instead of the git address currently there
  3. pip-compile dependencies/pip/requirements.in && pip-compile dependencies/pip/dev_requirements.in
  4. pip install -r dependencies/pip/dev_requirements.txt
  5. Create a project in kpi by uploading this form
    SimpleForm-copy.xlsx
  6. Deploy the project
  7. 🔴 [on main] Error. If you have debug mode on, it will say ValueError: "Label" column is not translated
  8. 🟢 [on branch] Project deploys successfully

@rgraber rgraber changed the title fix: allow headers to be capitalized fix: allow headers to be capitalized TASK-1174 Jan 30, 2025
@rgraber rgraber requested a review from jnm January 30, 2025 18:56
@rgraber rgraber self-assigned this Jan 30, 2025
@coveralls
Copy link

Coverage Status

coverage: 86.674%. remained the same
when pulling cb00206 on rsgraber/TASK-1174-allow-capital-label-header
into cc9aaf6 on main.

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.

2 participants