Skip to content

Commit

Permalink
Fixes for file upload issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jan 6, 2025
1 parent b42bfe6 commit 9009c7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions care/emr/api/viewsets/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def file_authorizer(user, file_type, associating_id, permission):
if permission == "read":
allowed = AuthorizationController.call(
"can_view_clinical_data", user, encounter_obj.patient
) or AuthorizationController.call(
"can_view_encounter_obj", user, encounter_obj
)
elif permission == "write":
allowed = AuthorizationController.call(
Expand Down
3 changes: 1 addition & 2 deletions care/emr/api/viewsets/questionnaire_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def get_queryset(self):
else:
obj = get_object_or_404(QuestionnaireResponse, self.kwargs["external_id"])
patient = obj.patient
if obj.encounter:
encounter = obj.encounter
encounter = obj.encounter
if encounter:
allowed = AuthorizationController.call(
"can_view_clinical_data", self.request.user, patient
Expand Down

0 comments on commit 9009c7f

Please sign in to comment.