| Line 22... |
Line 22... |
| 22 |
if couponMap:
|
22 |
if couponMap:
|
| 23 |
coupon_valid_upto = getISTDate(coupon.get("valid_upto"))
|
23 |
coupon_valid_upto = getISTDate(coupon.get("valid_upto"))
|
| 24 |
unmatched = couponMap.get("valid_upto")!=coupon_valid_upto or couponMap.get("offerText") != coupon.get("offerText")
|
24 |
unmatched = couponMap.get("valid_upto")!=coupon_valid_upto or couponMap.get("offerText") != coupon.get("offerText")
|
| 25 |
#Coupon is changed now. Update accordingly
|
25 |
#Coupon is changed now. Update accordingly
|
| 26 |
if unmatched:
|
26 |
if unmatched:
|
| - |
|
27 |
print couponMap.get("valid_upto")
|
| - |
|
28 |
print coupon_valid_upto
|
| - |
|
29 |
print couponMap.get("offerText")
|
| - |
|
30 |
print coupon.get("offerText")
|
| 27 |
old_coupon=session.query(paytm_coupons).filter_by(coupon=coupon.get("code")).filter(paytm_coupons.valid_upto<datetime.now()).one()
|
31 |
old_coupon=session.query(paytm_coupons).filter_by(coupon=coupon.get("code")).filter(paytm_coupons.valid_upto>datetime.now()).one()
|
| 28 |
old_coupon.valid_upto = datetime.now()
|
32 |
old_coupon.valid_upto = datetime.now()
|
| 29 |
couponsMap[coupon.get("code")] = coupon
|
33 |
couponsMap[coupon.get("code")] = coupon
|
| 30 |
paytm_coupon = paytm_coupons()
|
34 |
paytm_coupon = paytm_coupons()
|
| 31 |
paytm_coupon.coupon = coupon.get("code")
|
35 |
paytm_coupon.coupon = coupon.get("code")
|
| 32 |
paytm_coupon.offer_text = coupon.get("offerText")
|
36 |
paytm_coupon.offer_text = coupon.get("offerText")
|