feature/4009_csv_upload_conditional_fields #2440
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apply conditional field constraints to incoming csv data
This adds a validation step to the actual csv data import (as opposed to the explicit user-facing validation step), which applies form constraints to the data, which - among other things - applies conditional field constraints to the data.
This PR...
Developer Checklist
Developers should review and confirm each of these items before requesting review
constants
ormessages
filesdates
)url_for
not hard-codeddevelop
Reviewer Checklist
Reviewers should review and confirm each of these items before approval
If there are multiple reviewers, this section should be duplicated for each reviewer
constants
ormessages
filesdates
)url_for
not hard-codeddevelop
Testing
To test this, create an import CSV which changes a conditional field which is vulnerable to this error. For example
Has Other Fees: No
andOther fees information URL: [url]
. The url field is conditional on theHas Other Fees
header having the valueYes
. If you import a CSV with conflicting information on the current version of the system, then you will import both values. After this patch is applied, the url will be ignored.Deployment
What deployment considerations are there? (delete any sections you don't need)
Configuration changes
What configuration changes are included in this PR, and do we need to set specific values for production
Scripts
What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).
Migrations
What migrations need to be run to deploy this
Monitoring
What additional monitoring is required of the application as a result of this feature
New Infrastructure
What new infrastructure does this PR require (e.g. new services that need to run on the back-end).
Continuous Integration
What CI changes are required for this