Subversion Repositories SmartDukaan

Rev

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

Rev 6367 Rev 6679
Line 16... Line 16...
16
    user_client = UserClient().get_client()
16
    user_client = UserClient().get_client()
17
    user = user_client.getUserByCartId(cart.id)
17
    user = user_client.getUserByCartId(cart.id)
18
    
18
    
19
    email = user.email.lower().strip()
19
    email = user.email.lower().strip()
20
    
20
    
-
 
21
    if args['discountType'] != 'physical' and args['discountType'] != 'both':
-
 
22
        raise PromotionException(111, 'This coupon is not valid')
-
 
23
    
21
    if email in args['emails']:
24
    if args['emails'] == '*' or email in args['emails']:
22
        discount_value = args['discount']
25
        discount_value = args['discount']
23
    else:
26
    else:
24
        raise PromotionException(111, 'You are not entitled to use this Gift Voucher')
27
        raise PromotionException(111, 'You are not entitled to use this Gift Voucher')
25
 
28
 
26
    todate = datetime.datetime.now()      
29
    todate = datetime.datetime.now()