Exemplo n.º 1
0
    def submitOrder(self, order, auth):
        if is_valid_request(auth):
            # persist the new order
            processor = OrderProcessor()
            new_order = processor.create_order(order.name, order.address)

            # create thread and process order
            thread.start_new_thread(processor.process_order, (order.tracks,))

            # return the order unique id
            logger.info("Backoffice: Returning async request for submit order")
            return new_order.id
Exemplo n.º 2
0
    def submitOrder(self, order, auth):
        if is_valid_request(auth):
            #persist the new order
            processor = OrderProcessor()
            new_order = processor.create_order(order.name, order.address)

            #create thread and process order
            thread.start_new_thread(
                processor.process_order,
                (order.tracks, ),
            )

            #return the order unique id
            logger.info("Backoffice: Returning async request for submit order")
            return new_order.id
Exemplo n.º 3
0
 def setStatusOrder(self, order, status, auth):
     if is_valid_request(auth):
         Notificator(order).notificate_frontend(status)
         return "OK"
Exemplo n.º 4
0
 def getBudgetResponse(self, order, price, auth):
     if is_valid_request(auth):
         create_budget(auth.user_id, order, price)
         verify_and_finalize_order(order)
Exemplo n.º 5
0
 def getTracks(self, artist_name, auth):
     if is_valid_request(auth):
         response = LastFMClient().getArtistTracks(unquote(artist_name))
         logger.info("Backoffice: Returning request for tracks search")
         return response
Exemplo n.º 6
0
 def setStatusOrder(self, order, status, auth):
     if is_valid_request(auth):
         Notificator(order).notificate_frontend(status)
         return "OK"
Exemplo n.º 7
0
 def getBudgetResponse(self, order, price, auth):
     if is_valid_request(auth):
         create_budget(auth.user_id, order, price)
         verify_and_finalize_order(order)
Exemplo n.º 8
0
 def getTracks(self, artist_name, auth):
     if is_valid_request(auth):
         response = LastFMClient().getArtistTracks(unquote(artist_name))
         logger.info("Backoffice: Returning request for tracks search")
         return response