From 6e8b4ccb080800ee9074e609784c5974dfc1b355 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 2 Jan 2020 09:59:04 +0100 Subject: [PATCH] Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 --- openedx/features/enterprise_support/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/features/enterprise_support/api.py b/openedx/features/enterprise_support/api.py index e74bdda74b..3e779ec883 100644 --- a/openedx/features/enterprise_support/api.py +++ b/openedx/features/enterprise_support/api.py @@ -463,7 +463,7 @@ def consent_needed_for_course(request, user, course_id, enrollment_exists=False) """ consent_cache_key = get_data_consent_share_cache_key(user.id, course_id) data_sharing_consent_needed_cache = TieredCache.get_cached_response(consent_cache_key) - if data_sharing_consent_needed_cache.is_found and data_sharing_consent_needed_cache.value is 0: + if data_sharing_consent_needed_cache.is_found and data_sharing_consent_needed_cache.value == 0: return False enterprise_learner_details = get_enterprise_learner_data(user)