Subversion Repositories SmartDukaan

Rev

Rev 6282 | Rev 6679 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6282 Rev 6367
Line 23... Line 23...
23
    else:
23
    else:
24
        raise PromotionException(111, 'You are not entitled to use this Gift Voucher')
24
        raise PromotionException(111, 'You are not entitled to use this Gift Voucher')
25
 
25
 
26
    todate = datetime.datetime.now()      
26
    todate = datetime.datetime.now()      
27
    
27
    
28
    if args['endOn'] and todate > to_py_date(args['endOn']):
28
    if 'endOn' in args and todate > to_py_date(args['endOn']):
29
        raise PromotionException(113, 'This voucher is expired.')
29
        raise PromotionException(113, 'This voucher is expired.')
30
    
30
    
31
    count_coupon_usage = get_coupon_usage_count_by_user(coupon_code, user.userId)
31
    count_coupon_usage = get_coupon_usage_count_by_user(coupon_code, user.userId)
32
    if count_coupon_usage >= args['usage_limit_for_user']:
32
    if count_coupon_usage >= args['usage_limit_for_user']:
33
        raise PromotionException(112, 'This Gift Voucher is used.')
33
        raise PromotionException(112, 'This Gift Voucher is used.')