Skip to content
Snippets Groups Projects
Commit d191b52e authored by Mike O'Connell's avatar Mike O'Connell
Browse files

Check current enterprise for consent

When checking if consent is needed, ignore any enterprise
learner details that are not for the learner's currently
active enterprise.

ENT-3049
parent 9f14fcb5
No related merge requests found
......@@ -474,12 +474,14 @@ def consent_needed_for_course(request, user, course_id, enrollment_exists=False)
consent_needed = False
else:
client = ConsentApiClient(user=request.user)
current_enterprise_uuid = enterprise_customer_uuid_for_request(request)
consent_needed = any(
Site.objects.get(domain=learner['enterprise_customer']['site']['domain']) == request.site
current_enterprise_uuid == learner['enterprise_customer']['uuid']
and Site.objects.get(domain=learner['enterprise_customer']['site']['domain']) == request.site
and client.consent_required(
username=user.username,
course_id=course_id,
enterprise_customer_uuid=learner['enterprise_customer']['uuid'],
enterprise_customer_uuid=current_enterprise_uuid,
enrollment_exists=enrollment_exists,
)
for learner in enterprise_learner_details
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment