From 02436e35c0bb408ab1e6eec0912f9265e8760a75 Mon Sep 17 00:00:00 2001 From: abhigyanghosh30 Date: Fri, 5 Jan 2024 19:43:28 +0530 Subject: [PATCH] feat: add code query param to /pro/attach --- templates/pro/attach/index.html | 4 ++-- webapp/shop/advantage/views.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/pro/attach/index.html b/templates/pro/attach/index.html index b717d698918..70f84ef9d67 100644 --- a/templates/pro/attach/index.html +++ b/templates/pro/attach/index.html @@ -23,7 +23,7 @@

Attach your machine

@@ -79,4 +79,4 @@

Attach your machine

text-transform: uppercase; } -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/webapp/shop/advantage/views.py b/webapp/shop/advantage/views.py index dc0e4cebfbc..d31bca19d3f 100644 --- a/webapp/shop/advantage/views.py +++ b/webapp/shop/advantage/views.py @@ -647,10 +647,11 @@ def activate_magic_attach(advantage_mapper, **kwargs): @shop_decorator(area="advantage", permission="user", response="html") -@use_kwargs({"email": String(), "subscription": String()}, location="query") +@use_kwargs({"email": String(), "subscription": String(), "magic-attach-code": String()}, location="query") def magic_attach_view(advantage_mapper: AdvantageMapper, **kwargs): email = kwargs.get("email") selected_id = kwargs.get("subscription") + magic_attach_code = kwargs.get("magic-attach-code") user_subscriptions = advantage_mapper.get_user_subscriptions( email=email, marketplaces=["canonical-ua"] @@ -660,6 +661,7 @@ def magic_attach_view(advantage_mapper: AdvantageMapper, **kwargs): "pro/attach/index.html", subscriptions=user_subscriptions, selected_id=selected_id, + magic_attach_code = magic_attach_code, )