diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c0701ae01..807170133 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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. diff --git a/enterprise/__init__.py b/enterprise/__init__.py index 701028e69..c283d5e50 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "5.6.1" +__version__ = "5.6.2" diff --git a/enterprise/api/v1/views/enterprise_customer_members.py b/enterprise/api/v1/views/enterprise_customer_members.py index 4a41965cc..e850de6d0 100644 --- a/enterprise/api/v1/views/enterprise_customer_members.py +++ b/enterprise/api/v1/views/enterprise_customer_members.py @@ -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: diff --git a/enterprise/models.py b/enterprise/models.py index 3971c5697..65cd2bc7c 100644 --- a/enterprise/models.py +++ b/enterprise/models.py @@ -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