Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat: add discount_jwt monitoring #3944

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ecommerce/extensions/offer/dynamic_conditional_offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import crum
import waffle
from edx_django_utils.monitoring import set_custom_attribute
from oscar.core.loading import get_class, get_model

from ecommerce.extensions.api.handlers import jwt_decode_handler
Expand All @@ -30,8 +31,10 @@ def get_decoded_jwt_discount_from_request():
else:
discount_jwt = request.POST.get('discount_jwt')
if not discount_jwt:
set_custom_attribute('ecom_discount_jwt', 'not-found')
return None

set_custom_attribute('ecom_discount_jwt', 'found')
return jwt_decode_handler(discount_jwt)


Expand Down