From 6de5c092398ed70c8a5505425b45ed36d7697e01 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Tue, 22 May 2018 12:30:57 -0400 Subject: [PATCH] Fix the GDPR registration form for the mobile app. --- openedx/core/djangoapps/user_api/api.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/user_api/api.py b/openedx/core/djangoapps/user_api/api.py index fc663c9fdf..cbe80fe984 100644 --- a/openedx/core/djangoapps/user_api/api.py +++ b/openedx/core/djangoapps/user_api/api.py @@ -1,4 +1,5 @@ import copy +import crum from django.conf import settings from django.core.exceptions import ImproperlyConfigured @@ -12,6 +13,7 @@ from edxmako.shortcuts import marketing_link from openedx.core.djangolib.markup import HTML, Text from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.user_api.helpers import FormDescription +from openedx.core.lib.mobile_utils import is_request_from_mobile_app from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG from openedx.features.enterprise_support.api import enterprise_customer_for_request from student.forms import get_registration_extension_form @@ -831,7 +833,11 @@ class RegistrationFormFactory(object): field_type = 'checkbox' if ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context() and not separate_honor_and_tos: - field_type = 'plaintext' + current_request = crum.get_current_request() + + if not is_request_from_mobile_app(current_request): + field_type = 'plaintext' + pp_link = marketing_link("PRIVACY") label = Text(_( u"By creating an account with {platform_name}, you agree \