Skip to content

Commit

Permalink
feat: exclude unlinked member records from enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed Jan 16, 2025
1 parent 9779f3e commit 844a183
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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

0 comments on commit 844a183

Please sign in to comment.