From 2cc0688e1ce67edd06f130dc9156ac5afdd1ca3c Mon Sep 17 00:00:00 2001 From: muhammad-ammar Date: Tue, 3 Nov 2020 00:20:05 +0500 Subject: [PATCH] convert enterprise customer uuid to str before comparison ENT-3494 --- openedx/features/enterprise_support/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/features/enterprise_support/api.py b/openedx/features/enterprise_support/api.py index 725f78db5e..6e4c3d008d 100644 --- a/openedx/features/enterprise_support/api.py +++ b/openedx/features/enterprise_support/api.py @@ -574,7 +574,7 @@ def consent_needed_for_course(request, user, course_id, enrollment_exists=False) client = ConsentApiClient(user=request.user) current_enterprise_uuid = enterprise_customer_uuid_for_request(request) consent_needed = any( - current_enterprise_uuid == learner['enterprise_customer']['uuid'] + str(current_enterprise_uuid) == str(learner['enterprise_customer']['uuid']) and Site.objects.get(domain=learner['enterprise_customer']['site']['domain']) == request.site and client.consent_required( username=user.username, @@ -587,7 +587,7 @@ def consent_needed_for_course(request, user, course_id, enrollment_exists=False) if not consent_needed: for learner in enterprise_learner_details: - if current_enterprise_uuid != learner['enterprise_customer']['uuid']: + if str(current_enterprise_uuid) != str(learner['enterprise_customer']['uuid']): LOGGER.info( '[ENTERPRISE DSC] Consent requirement failed due to enterprise mismatch. ' 'USER: [%s], CurrentEnterprise: [%s], LearnerEnterprise: [%s]',