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

feat: exclude unlinked learner records from enterprise-customer-members results #2317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[5.6.2]
--------
* feat: exclude unlinked member records from enterprise-customer-members and enterprise_group endpoints

[5.6.1]
--------
* fix: Log all learner transmission records.
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "5.6.1"
__version__ = "5.6.2"
5 changes: 4 additions & 1 deletion enterprise/api/v1/views/enterprise_customer_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def get_members(self, request, *args, **kwargs):
FROM enterprise_enterprisecustomeruser ecu
INNER JOIN auth_user as au on ecu.user_id = au.id
LEFT JOIN auth_userprofile as aup on au.id = aup.user_id
WHERE ecu.enterprise_customer_id = %s
WHERE
ecu.enterprise_customer_id = %s
AND
ecu.linked = 1
) SELECT * FROM users {user_query_filter} ORDER BY full_name;
"""
try:
Expand Down
5 changes: 4 additions & 1 deletion enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4703,7 +4703,10 @@ def _get_filtered_ecu_ids(self, user_query):
from enterprise_enterprisecustomeruser ecu
inner join auth_user au on ecu.user_id = au.id
left join auth_userprofile aup on au.id = aup.user_id
where ecu.enterprise_customer_id = %s
where
ecu.enterprise_customer_id = %s
and
ecu.linked = 1
) select id from users where email like %s or full_name like %s;
"""
# Raw sql is picky about uuid format
Expand Down
Loading