Subversion Repositories SmartDukaan

Rev

Rev 7475 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7475 Rev 8203
Line 19... Line 19...
19
    email = user.email.lower().strip()
19
    email = user.email.lower().strip()
20
    
20
    
21
    if args['couponType'] is not None and args['couponType'] != 'physical' and args['couponType'] != 'both':
21
    if args['couponType'] is not None and args['couponType'] != 'physical' and args['couponType'] != 'both':
22
        raise PromotionException(111, 'This coupon is not valid')
22
        raise PromotionException(111, 'This coupon is not valid')
23
    
23
    
24
    if args['emails'] == '*' or email in args['emails']:
24
    if args['emails'] == '*' or email in [em.lower() for em in args['emails']]:
25
        discount_value_left = args['discount']
25
        discount_value_left = args['discount']
26
    else:
26
    else:
27
        raise PromotionException(111, 'You are not allowed to use this coupon')
27
        raise PromotionException(111, 'You are not allowed to use this coupon')
28
    
28
    
29
    todate = datetime.datetime.now()
29
    todate = datetime.datetime.now()