this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix:updated exception validations in diagnostic report api (#3540)

fix:updated the validations

authored by

Nandkishor R and committed by
GitHub
5287e2bc 38a27166

+5 -5
+5 -5
care/emr/api/viewsets/diagnostic_report.py
··· 2 2 from drf_spectacular.utils import extend_schema 3 3 from pydantic import UUID4, BaseModel 4 4 from rest_framework.decorators import action 5 - from rest_framework.exceptions import ValidationError 5 + from rest_framework.exceptions import PermissionDenied, ValidationError 6 6 from rest_framework.filters import OrderingFilter 7 7 from rest_framework.response import Response 8 8 ··· 88 88 self.request.user, 89 89 get_object_or_404(ServiceRequest, external_id=instance.service_request), 90 90 ): 91 - raise ValidationError( 91 + raise PermissionDenied( 92 92 "You do not have permission to write this diagnostic report" 93 93 ) 94 94 ··· 98 98 self.request.user, 99 99 model_instance.service_request, 100 100 ): 101 - raise ValidationError( 101 + raise PermissionDenied( 102 102 "You do not have permission to write this diagnostic report" 103 103 ) 104 104 ··· 109 109 model_instance.service_request, 110 110 ): 111 111 return 112 - raise ValidationError( 113 - "You do not have permission to write this diagnostic report" 112 + raise PermissionDenied( 113 + "You do not have permission to read this diagnostic report" 114 114 ) 115 115 116 116 def get_queryset(self):