Fix validation for resource fields using preset datetime_tz #435
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.
Validation for resource fields using the preset
datetime_tz
does not work. For datasets the validation works fine.Let's say I have a field called
start_time
under a resource using the presetdatetime_tz
. Submitting this field (or more accurately the three fields for date, time and tz which it gets split into) from the form will result in three different fields being saved in the database under extras:start_time_time
,start_time_date
andstart_time_tz
. This happens because the keys for resources are different in the data passed from the form to the validator method compared to the keys used for datasets.This pull request contains a fix to the validator as well as a test case. Please make suggestions or corrections if there is a better or more appropriate way to solve this issue.