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

fix: sort DatedMeasures within a RequestSnapshot #443

Merged
merged 26 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a983175
build: release 3.24.0
Nov 20, 2024
37844fd
feat: add request migration script 1.6.0
pl-buiquang Nov 19, 2024
19c20d5
build: release version 3.24.1
pl-buiquang Nov 21, 2024
a40675e
fix: add extra info to logs
Nov 26, 2024
ba81e96
fix(maintenance): message on deletion and prevent sooner ending (#428)
pl-buiquang Dec 3, 2024
c67eaf1
build: set version to 3.24.3
pl-buiquang Dec 3, 2024
2dca8fb
refactor(start)!: add new docker entrypoint options (#427)
pl-buiquang Nov 27, 2024
70d1288
fix(logger): listen 0.0.0.0 for socket logger
pl-buiquang Nov 27, 2024
30e3c55
feat(logging): readd default console logger
pl-buiquang Nov 28, 2024
89abc3b
feat: add configurable socket logger host for gunicorn
pl-buiquang Nov 28, 2024
a0c0f93
feat(auth): cache oidc issuer certs (#433)
pl-buiquang Dec 20, 2024
2c5cd04
fix(start): add more options for Docker entrypoint
Dec 23, 2024
878f0b0
Revert "feat(auth): cache oidc issuer certs (#433)"
Dec 23, 2024
055486a
fix(cache): revert caching OIDC server certs
Dec 23, 2024
64499e3
fix(exports): validate payload when passed a FHIR filter
Dec 23, 2024
b37abc7
fix(DMs): fix decorators
Jan 1, 2025
843500f
build: set version to 3.24.7
Jan 2, 2025
024d83e
fix(DMs): small and diverse fixes
Jan 2, 2025
3cae422
refactor(accesses): add cache and fail fast flow
Jan 6, 2025
4ad115d
test: add missing fields when creating accesses
Jan 7, 2025
e1fca0a
refactor: leverage cache and Django ORM capabilities
Jan 7, 2025
193eb09
fix(accesses): add env var for managers list file
Jan 8, 2025
b214943
refactor: add some debug log for auth
pl-buiquang Jan 16, 2025
35adb39
build: set hotfix version 3.24.11
pl-buiquang Jan 16, 2025
381fc2f
fix(cohort): sort DMs within an RQS
Jan 21, 2025
6156271
fix: merge main into hotfix_3.24.12_sort_dms_within_rqs
Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions admin_cohort/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@

def _get_authenticator(self, auth_method: str):
try:
_logger.info(f"Authenticating using {auth_method}")
return self.authenticators[auth_method]
except KeyError as ke:
_logger.error(f"Invalid authentication method : {auth_method}")
Expand Down Expand Up @@ -307,6 +308,7 @@
return None
try:
authenticator = self._get_authenticator(auth_method)
_logger.info(f"Authenticating token: {token}")

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarQube Cloud
username = authenticator.authenticate(token=token)
user = User.objects.get(username=username)
for post_auth_hook in self.post_auth_hooks:
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
Loading