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

Adds archive_reason to FileUpload and validate if is_archived #1055

Merged

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Oct 7, 2022

Closes #1054
Required by coronasafe/care_fe#3366

Proposed Changes

  • Adds non-mandatory text field archive_reason
  • Validate archive_reason to be mandatory if is_archived is set.
  • Raises validation error if an update is attempted after being archived.

image

@coronasafe/code-reviewers

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete

@rithviknishad rithviknishad requested a review from a team as a code owner October 7, 2022 03:06
@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2022

Codecov Report

Base: 56.09% // Head: 56.07% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (7c7749a) compared to base (0e257a6).
Patch coverage: 41.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1055      +/-   ##
==========================================
- Coverage   56.09%   56.07%   -0.03%     
==========================================
  Files         175      175              
  Lines        8618     8630      +12     
  Branches     1460     1477      +17     
==========================================
+ Hits         4834     4839       +5     
- Misses       3732     3739       +7     
  Partials       52       52              
Impacted Files Coverage Δ
care/facility/api/serializers/file_upload.py 45.71% <36.36%> (-1.66%) ⬇️
care/facility/models/file_upload.py 68.00% <100.00%> (+0.65%) ⬆️
care/users/api/viewsets/change_password.py 61.53% <0.00%> (+1.53%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rithviknishad rithviknishad changed the title File upload/archive reason Adds archive_reason to FileUpload and validate if is_archived Oct 7, 2022
@vigneshhari
Copy link
Member

We should also not let them update the archive reason. I believe that was the conclusion from the last call with @aparnacoronasafe , Do confirm before you make this change.

@aparnacoronasafe
Copy link
Member

We should also not let them update the archive reason. I believe that was the conclusion from the last call with @aparnacoronasafe , Do confirm before you make this change.

I agree with vig

@rithviknishad
Copy link
Member Author

rithviknishad commented Oct 8, 2022

@vigneshhari I've pushed the changes required.

@sonarcloud
Copy link

sonarcloud bot commented Oct 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vigneshhari vigneshhari merged commit 0beaa72 into coronasafe:master Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field for having a reason why the file is archived in the consultation files api
4 participants