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

[PROD] Data validation for OpsLearning while filling data to the db #2293

Open
szabozoltan69 opened this issue Oct 25, 2024 · 0 comments
Open
Assignees

Comments

@szabozoltan69
Copy link
Contributor

szabozoltan69 commented Oct 25, 2024

Issue

For OpsLearning records there is a validation workflow process:

  1. Data are not validated
  2. Not validated data can be changed
  3. Validation happens
  4. Data are validated (and is_validated flag is true)
  5. Validated data can be changed

If the is_validated field is false, we can suppose that the validation has not happened. For such records we should not allow to have ..._validated fields to be filled in (neither from Admin page, neither from API input), because otherwise it is difficult to define the moment, that "now" happened the validation, and we can populate the validated fields (based on not validated pairs) at that "save" moment: https://github.com/IFRCGo/go-api/blob/develop/per/models.py#L723

Or, if there is a nicer definition for the "save" moment when we can overwrite _validated fields with the non-validated pairs, it can be implemented. Until now we used all the fields to check that no data is in "validated" fields (at validation moment), but this way is not great if these fields can be filled up via API.

We should check if the API sending really requires to have some _validated fields also. If so, we should fix it.

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

No branches or pull requests

1 participant