diff --git a/app.py b/app.py index e681df2f..2595f64c 100755 --- a/app.py +++ b/app.py @@ -1602,7 +1602,7 @@ def calculate_subscription_price(): data = request.get_json() to_plan = data.get('to_plan') to_cycle = data.get('to_cycle') - promo_code = data.get('promo_code', '').strip() or None + promo_code = (data.get('promo_code') or '').strip() or None if not to_plan or not to_cycle: return jsonify({'success': False, 'error': '参数不完整'}), 400 @@ -1638,7 +1638,7 @@ def create_payment_order(): data = request.get_json() plan_name = data.get('plan_name') billing_cycle = data.get('billing_cycle') - promo_code = data.get('promo_code', '').strip() or None + promo_code = (data.get('promo_code') or '').strip() or None if not plan_name or not billing_cycle: return jsonify({'success': False, 'error': '参数不完整'}), 400