Skip to content

Commit

Permalink
Added is_mobile_app flag in edly context processor (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Haseeb authored Dec 14, 2020
1 parent ef99f96 commit a65103f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openedx/features/edly/context_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.conf import settings
from edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.lib.mobile_utils import is_request_from_mobile_app

DEFAULT_SERVICES_NOTIFICATIONS_COOKIE_EXPIRY = 180 # value in seconds
DEFAULT_COLOR_DICT = {
Expand Down Expand Up @@ -65,6 +66,7 @@ def edly_app_context(request): # pylint: disable=unused-argument
'zendesk_widget_url': marketing_link('ZENDESK-WIDGET'),
'footer_url': marketing_link('FOOTER'),
'gtm_id': configuration_helpers.get_value('GTM_ID'),
'is_mobile_app': is_request_from_mobile_app(request)
}
)

Expand Down
1 change: 1 addition & 0 deletions openedx/features/edly/tests/test_context_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ def test_default_edly_app_context(self):
self.assertEqual(context['zendesk_widget_url'], marketing_link('ZENDESK-WIDGET'))
self.assertEqual(context['footer_url'], marketing_link('FOOTER'))
self.assertEqual(context['gtm_id'], 'GTM-XXXXXX')
self.assertEqual(context['is_mobile_app'], False)

0 comments on commit a65103f

Please sign in to comment.