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: Update validation for Daily Round form #1898

Closed
wants to merge 1 commit into from

Conversation

aeswibon
Copy link
Member

@aeswibon aeswibon commented Feb 19, 2024

Bug Fix

Proposed Changes

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@aeswibon aeswibon marked this pull request as ready for review February 19, 2024 14:29
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 62.07%. Comparing base (e435d9e) to head (bdbb64f).
Report is 80 commits behind head on develop.

Files Patch % Lines
care/facility/api/serializers/daily_round.py 18.18% 24 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1898      +/-   ##
===========================================
- Coverage    62.19%   62.07%   -0.13%     
===========================================
  Files          221      221              
  Lines        12203    12235      +32     
  Branches      1742     1755      +13     
===========================================
+ Hits          7590     7595       +5     
- Misses        4305     4329      +24     
- Partials       308      311       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aeswibon
Copy link
Member Author

@sainak Can you check the PR?

Comment on lines 345 to 429
if "temperature" in validated:
if validated["temperature"] < 95 or validated["temperature"] > 106:
raise ValidationError(
{"temperature": ["This field value must be between 95 and 106."]}
)

if "additional_symptoms" in validated:
if SymptomChoiceDict["OTHERS"] in validated["additional_symptoms"]:
if "other_symptoms" not in validated:
raise ValidationError(
{
"other_symptoms": [
"This field is required if OTHERS is selected in Additional Symptoms."
]
}
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use field level validation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sainak
Copy link
Member

sainak commented Feb 26, 2024

@aeswibon missing validation for other fields

@aeswibon
Copy link
Member Author

@sainak I have added the validation

@aeswibon aeswibon requested a review from sainak March 13, 2024 18:16
@sainak sainak added the to-be-closed PRs with no updates in the last 3 weeks will be closed label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-be-closed PRs with no updates in the last 3 weeks will be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update validation for Daily Round form
3 participants