From 5f46cf9681e16c710905cc25ed587ea7a0e4b0c9 Mon Sep 17 00:00:00 2001 From: Usama Bin Nadeem <32700508+usamabinnadeem-10@users.noreply.github.com> Date: Thu, 28 Nov 2024 23:55:38 +0500 Subject: [PATCH] customise thank you page for each sign up form (#14514) --- templates/credentials/sign-up.html | 4 ++-- templates/credentials/thank-you.html | 4 ++++ webapp/app.py | 4 ++++ webapp/shop/cred/views.py | 14 ++++++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/templates/credentials/sign-up.html b/templates/credentials/sign-up.html index 5e36a02393a..a6575088b52 100644 --- a/templates/credentials/sign-up.html +++ b/templates/credentials/sign-up.html @@ -22,7 +22,7 @@
Error
formid="3801", lpId="7140", sign_up_open=sign_up_open, - returnURL="/credentials/thank-you" %} + returnURL="/credentials/thank-you?type=sme" %} {% include "shared/_credentials-signup-sme-form.html" %} {% endwith %} {% endif %} @@ -31,7 +31,7 @@
Error
formid="3801", lpId="7140", sign_up_open=sign_up_open, - returnURL="/credentials/thank-you" %} + returnURL="/credentials/thank-you?type=tester" %} {% include "shared/_credentials-signup-tester-form.html" %} {% endwith %} {% endif %} diff --git a/templates/credentials/thank-you.html b/templates/credentials/thank-you.html index 654933d2fd8..fc8735588c7 100644 --- a/templates/credentials/thank-you.html +++ b/templates/credentials/thank-you.html @@ -17,7 +17,11 @@

Ubuntu CUE

+ {% if signup_type == 'sme' %} + Once our next exam is ready for community contributions, we’ll review applications and contact candidates with the appropriate profile. + {% else %} Once our next exam enters the testing phase, we’ll review applications and contact qualified testers with the appropriate profile. + {% endif %}

diff --git a/webapp/app.py b/webapp/app.py index 75f460a9cb5..4fb3729cb8b 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -89,6 +89,7 @@ cred_shop_webhook_responses, cred_shop_keys, cred_sign_up, + cred_thank_you, cred_submit_form, cred_syllabus_data, cred_your_exams, @@ -891,6 +892,9 @@ def takeovers_index(): app.add_url_rule( "/credentials/sign-up", view_func=cred_sign_up, methods=["GET", "POST"] ) +app.add_url_rule( + "/credentials/thank-you", view_func=cred_thank_you, methods=["GET"] +) app.add_url_rule( "/credentials/schedule", view_func=cred_schedule, diff --git a/webapp/shop/cred/views.py b/webapp/shop/cred/views.py index 3441822de28..136932551fd 100644 --- a/webapp/shop/cred/views.py +++ b/webapp/shop/cred/views.py @@ -336,9 +336,19 @@ def extract_json_comment(obj): return flask.redirect(return_url) if referrer: - return flask.redirect(f"/thank-you?referrer={referrer}") + return flask.redirect( + f"/thank-you?referrer={referrer}?type={search_type}" + ) else: - return flask.redirect("/thank-you") + return flask.redirect(f"/thank-you?type={search_type}") + + +@shop_decorator(area="cred", response="html") +def cred_thank_you(**_): + signup_type = flask.request.args.get("type") + return flask.render_template( + "credentials/thank-you.html", signup_type=signup_type + ) @shop_decorator(area="cred", permission="user", response="html")