Subversion Repositories SmartDukaan

Rev

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

Rev 17611 Rev 17613
Line 1513... Line 1513...
1513
        resp.body = dumps(result)
1513
        resp.body = dumps(result)
1514
 
1514
 
1515
    
1515
    
1516
    def on_post(self, req, resp):
1516
    def on_post(self, req, resp):
1517
        
1517
        
1518
        multi = req.get_param_as_int("multi")
-
 
1519
        
1518
        
1520
        try:
1519
        try:
1521
            result_json = json.loads(req.stream.read(), encoding='utf-8')
1520
            result_json = json.loads(req.stream.read(), encoding='utf-8')
1522
        except ValueError:
1521
        except ValueError:
1523
            raise falcon.HTTPError(falcon.HTTP_400,
1522
            raise falcon.HTTPError(falcon.HTTP_400,
1524
                'Malformed JSON',
1523
                'Malformed JSON',
1525
                'Could not decode the request body. The '
1524
                'Could not decode the request body. The '
1526
                'JSON was incorrect.')
1525
                'JSON was incorrect.')
1527
            
1526
            
1528
        result = Mongo.addFeaturedDealForDealObject(result_json, multi)
1527
        result = Mongo.addFeaturedDealForDealObject(result_json)
1529
        resp.body = json.dumps(result, encoding='utf-8')
1528
        resp.body = json.dumps(result, encoding='utf-8')
1530
 
1529
 
1531
 
1530
 
1532
    
1531
    
1533
    
1532