Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ohcnetwork/care into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jan 4, 2025
2 parents eb252cb + b741a01 commit 26f2c5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions care/emr/api/viewsets/file_upload.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.utils import timezone
from django_filters import rest_framework as filters
from pydantic import BaseModel
from rest_framework.decorators import action
from rest_framework.exceptions import PermissionDenied
Expand Down Expand Up @@ -50,6 +51,10 @@ def file_authorizer(user, file_type, associating_id, permission):
raise PermissionDenied("Cannot View File")


class FileUploadFilter(filters.FilterSet):
is_archived = filters.BooleanFilter(field_name="is_archived")


class FileUploadViewSet(
EMRCreateMixin, EMRRetrieveMixin, EMRUpdateMixin, EMRListMixin, EMRBaseViewSet
):
Expand All @@ -58,6 +63,8 @@ class FileUploadViewSet(
pydantic_retrieve_model = FileUploadRetrieveSpec
pydantic_update_model = FileUploadUpdateSpec
pydantic_read_model = FileUploadListSpec
filterset_class = FileUploadFilter
filter_backends = [filters.DjangoFilterBackend]

def authorize_create(self, instance):
file_authorizer(
Expand Down
2 changes: 1 addition & 1 deletion care/emr/api/viewsets/scheduling/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def availability_stats(self, request, *args, **kwargs):
booked_slots = (
TokenSlot.objects.filter(
start_datetime__lte=request_data.to_date,
end_datetime__gte=request_data.from_date,
end_datetime__gt=request_data.from_date,
resource=resource,
)
.values("start_datetime__date")
Expand Down

0 comments on commit 26f2c5e

Please sign in to comment.