Skip to content

Commit

Permalink
fix(cohort): sort DMs within an RQS
Browse files Browse the repository at this point in the history
  • Loading branch information
Hicham committed Jan 21, 2025
1 parent 35adb39 commit 381fc2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin_cohort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from celery.schedules import crontab

TITLE = "Portail/Cohort360 API"
VERSION = "3.24.11"
VERSION = "3.24.12"
AUTHOR = "Assistance Publique - Hopitaux de Paris, Département I&D"
DESCRIPTION_MD = f"""Supports the official **Cohort360** web app and **Portail**
Built by **{AUTHOR}**
Expand Down
6 changes: 5 additions & 1 deletion cohort/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class RQSSerializer(BaseSerializer):
owner = UserPrimaryKeyRelatedField(queryset=User.objects.all(), required=False)
request = PrimaryKeyRelatedFieldWithOwner(queryset=Request.objects.all(), required=False)
previous_snapshot = PrimaryKeyRelatedFieldWithOwner(required=False, queryset=RequestQuerySnapshot.objects.all())
dated_measures = DatedMeasureSerializer(many=True, read_only=True)
dated_measures = serializers.SerializerMethodField()
cohort_results = CohortResultSerializer(many=True, read_only=True)
shared_by = UserSerializer(allow_null=True, read_only=True)

Expand All @@ -195,6 +195,10 @@ class Meta:
"cohort_results",
"shared_by"]

def get_dated_measures(self, obj):
dated_measures = obj.dated_measures.all().order_by('-modified_at')
return DatedMeasureSerializer(dated_measures, many=True).data


class RQSCreateSerializer(serializers.ModelSerializer):
class Meta:
Expand Down

0 comments on commit 381fc2f

Please sign in to comment.