summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2021-02-24 11:25:06 +0100
committerMS <ms@taler.net>2021-02-24 11:25:06 +0100
commit9e865890b62b67af41e6ded2da23e23702e88e8b (patch)
tree63d95d43bae756e5621335286bae54ba3d8703a9
parent3cd543c8fb8997f8679527c4d297bb400ffd8d81 (diff)
downloadtaler-merchant-demos-9e865890b62b67af41e6ded2da23e23702e88e8b.tar.gz
taler-merchant-demos-9e865890b62b67af41e6ded2da23e23702e88e8b.tar.bz2
taler-merchant-demos-9e865890b62b67af41e6ded2da23e23702e88e8b.zip
fix url join
-rw-r--r--talermerchantdemos/landing/landing.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/talermerchantdemos/landing/landing.py b/talermerchantdemos/landing/landing.py
index 4c1c925..170a950 100644
--- a/talermerchantdemos/landing/landing.py
+++ b/talermerchantdemos/landing/landing.py
@@ -142,15 +142,26 @@ def index():
@app.route("/<lang>/", methods=["GET"])
def start(lang):
- bank_url = os.environ.get("TALER_ENV_URL_BANK", "#")
- if bank_url != "#":
- bank_url = urljoin(bank_url, f"/{lang}/register")
+ if x:= os.environ.get("TALER_ENV_URL_BANK"): bank_register_url = "/".join([x.strip("/"), f"{lang}/register"])
+ else: bank_register_url = "#"
+
+ if x:= os.environ.get("TALER_ENV_URL_MERCHANT_BLOG"): merchant_blog_url = "/".join([x.strip("/"), lang])
+ else: merchant_blog_url = "#"
+
+ if x:= os.environ.get("TALER_ENV_URL_MERCHANT_DONATIONS"): merchant_donations_url = "/".join([x.strip("/"), lang])
+ else: merchant_donations_url = "#"
+
+ if x:= os.environ.get("TALER_ENV_URL_MERCHANT_SURVEY"): merchant_survey_url = "/".join([x.strip("/"), lang])
+ else: merchant_survey_url = "#"
+
return flask.render_template(
"templates/index.html.j2",
merchant_currency=CURRENCY,
lang=lang,
- bank_url=bank_url,
- merchant_blog_url=os.environ.get("TALER_ENV_URL_MERCHANT_BLOG", "#")
+ bank_url=bank_register_url,
+ merchant_blog_url=merchant_blog_url,
+ merchant_donations_url=merchant_donations_url,
+ merchant_survey_url=merchant_survey_url
)
@app.errorhandler(404)