app/admin/admin_views.py
def put(self, id):
        '''mark an order as completed by admin'''
        order = Order().get_by_id(id)

        if order:
            if order.status == "completed" or order.status == "declined":
                return {"message": "order already {}".format(order.status)}

            if order.status == "Pending":
                return {"message": "please approve the order first "}

            if order.status == "In Transit":
                order.status = "completed"
                return {
                    "message":
                    "Your has been order completed awaiting delivery"
                }

        return {"message": "Order not found"}, 404
mark an order as completed by admin
mark an order as completed by admin
mark an order as completed by admin
def put(self, id):
        order = Order().get_by_id(id)
        if order:
            if order.status == "completed" or order.status == "declined":
                return {"message": "order already {}".format(order.status)}
            if order.status == "Pending":
                return {"message": "please approve the order first "}
            if order.status == "In Transit":
                order.status = "completed"
                return {
                    "message":
                    "Your has been order completed awaiting delivery"
                }
        return {"message": "Order not found"}, 404
def put ( self , id ) : order = Order ( ) . get_by_id ( id ) if order : if order . status == "completed" or order . status == "declined" : return { "message" : "order already {}" . format ( order . status ) } if order . status == "Pending" : return { "message" : "please approve the order first " } if order . status == "In Transit" : order . status = "completed" return { "message" : "Your has been order completed awaiting delivery" } return { "message" : "Order not found" } , 404
mark an order as completed by admin
mark an order as completed by admin
'''mark an order as completed by admin'''
self
id