From c718c02d6ef63f4fd5d4f4130c325b339b45c23d Mon Sep 17 00:00:00 2001 From: Zia Fazal Date: Mon, 7 Oct 2019 16:59:15 +0500 Subject: [PATCH] Show blank screen instead of logout message for Enterprise SSO flow Changes to show blank screen instead of logout message for Enterprise SSO flow. It confuses learner when they are already signed in and access their course from B2B site. ENT-1688 Fixed pep8 quality violation use testserver as HOST instead of edx.org assert enterprise app is enabled added logging Print different values Reload django url config assert all quote operations to see how they work on jenkins debug url resolved values login user in setup added log to debug test on jenkins Using UrlResetMixin Using regex instead of resolve Fixed quality violation Fixed pylint quality violations Fixed target interpolation syntax Added developer's comment --- lms/templates/logout.html | 31 +++++++-- .../djangoapps/user_authn/views/logout.py | 15 ++++- .../enterprise_support/tests/test_logout.py | 64 +++++++++++++++++++ 3 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 openedx/features/enterprise_support/tests/test_logout.py diff --git a/lms/templates/logout.html b/lms/templates/logout.html index e418804eb9..617c463ad1 100644 --- a/lms/templates/logout.html +++ b/lms/templates/logout.html @@ -5,14 +5,31 @@ {% block title %}{% trans "Signed Out" as tmsg %}{{ tmsg | force_escape }} | {{ block.super }}{% endblock %} {% block body %} -

{% trans "You have signed out." as tmsg %}{{ tmsg | force_escape }}

+ {% if enterprise_target %} + {% comment %} + For enterprise SSO flow we intentionally drop learner's session. + We are showing this signin message instead of logout message + to avoid any confusion for learner in that case. + {% endcomment %} +

{% trans "We are signing you in." as tmsg %}{{ tmsg | force_escape }}

-

- {% blocktrans trimmed asvar signout_msg1 %} - If you are not redirected within 5 seconds, {start_anchor}click here to go to the home page{end_anchor}. - {% endblocktrans %} - {% interpolate_html signout_msg1 start_anchor=''|safe end_anchor=''|safe %} -

+

+ {% filter force_escape %} + {% blocktrans %} + This may take a minute. If you are not redirected, go to the home page. + {% endblocktrans %} + {% endfilter %} +

+ {% else %} +

{% trans "You have signed out." as tmsg %}{{ tmsg | force_escape }}

+ +

+ {% blocktrans trimmed asvar signout_msg1 %} + If you are not redirected within 5 seconds, {start_anchor}click here to go to the home page{end_anchor}. + {% endblocktrans %} + {% interpolate_html signout_msg1 start_anchor=''|safe end_anchor=''|safe %} +

+ {% endif %}