nagasurendra commited on
Commit
2f477ff
·
verified ·
1 Parent(s): 808f0fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1034,6 +1034,8 @@ def checkout():
1034
  # Remove only the selected coupon
1035
  updated_coupons = [coupon for coupon in existing_coupons if coupon.strip() != selected_coupon]
1036
  updated_coupons_str = "\n".join(updated_coupons).strip()
 
 
1037
 
1038
  sf.Referral_Coupon__c.update(referral_coupon_id, {
1039
  "Coupon_Code__c": updated_coupons_str
 
1034
  # Remove only the selected coupon
1035
  updated_coupons = [coupon for coupon in existing_coupons if coupon.strip() != selected_coupon]
1036
  updated_coupons_str = "\n".join(updated_coupons).strip()
1037
+ if not updated_coupons:
1038
+ updated_coupons_str = None # Set to None if no coupons are left
1039
 
1040
  sf.Referral_Coupon__c.update(referral_coupon_id, {
1041
  "Coupon_Code__c": updated_coupons_str