Skip to content

feat: require national_id query param in programs#298

Merged
johanseto merged 3 commits intomasterfrom
jlc/national-id-constraint-programs
Nov 4, 2025
Merged

feat: require national_id query param in programs#298
johanseto merged 3 commits intomasterfrom
jlc/national-id-constraint-programs

Conversation

@johanseto
Copy link
Collaborator

@johanseto johanseto commented Oct 29, 2025

Description

Testing instructions

feat: require national_id query param in programs

Before

2025-10-29_10-28_2

After

2025-10-29_10-28_1
  • is_enrolled querypam by default would be true.
Screencast.from.29-10-25.11.02.30.webm

Additional information

Jira story: https://edunext.atlassian.net/browse/FUTUREX-1544

@github-actions github-actions bot added test size/m m lines label labels Oct 29, 2025
@johanseto johanseto force-pushed the jlc/national-id-constraint-programs branch from 4aaf464 to 79005a3 Compare October 29, 2025 15:56
List of enrolled courses for the user qs
"""
if getattr(self.request, 'user_by_national_id', None):
if self.request.query_params.get("is_enrolled", "true") == "true":
Copy link
Collaborator Author

@johanseto johanseto Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrey-canon Do you think the default should be truthy? or falsy, so that all defaults should return visible courses for the user? And then filter the enrolled?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think this filter is necessary. What I mean is that the endpoint has basically changed to one focused on returning user information plus the programs associated with that user.

So, having an option that just returns the programs a user can see — without including any relevant user data — doesn’t really make sense to me.

In fact, I believe the next block, which filters by enrollments, should now be the default behavior returned by the get_queryset method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base automatically changed from jlc/snake-case-programs to master October 29, 2025 23:23
@johanseto johanseto force-pushed the jlc/national-id-constraint-programs branch from 79005a3 to 1618676 Compare October 29, 2025 23:24
Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

def filter_queryset(self, queryset):
"""
Filter the queryset by course enrolled if the national_id query param is present.
Filter the queryset...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can improve this comment, feel free to do that in this pr or in the next one where you are implementing the logic

@johanseto johanseto merged commit 5414c8c into master Nov 4, 2025
9 checks passed
@johanseto johanseto deleted the jlc/national-id-constraint-programs branch November 4, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m m lines label test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants