def update_bid(self, bid_basket_item_id, amount):
    '\n        Update amount of bid. Delete bid if amount is 0.\n        '
    try:
        amount = Decimal(amount)
    except Exception as e:
        amount = Decimal('0')
    bid_basket_item = self.bids.get(pk=bid_basket_item_id)
    if (not bid_basket_item.is_locked()):
        if (amount == 0):
            bid_basket_item.delete()
        else:
            bid_basket_item.amount = amount
            bid_basket_item.save()
        self.save()
    return bid_basket_item
Update amount of bid. Delete bid if amount is 0.
def update_bid(self, bid_basket_item_id, amount):
    '\n        \n        '
    try:
        amount = Decimal(amount)
    except Exception as e:
        amount = Decimal('0')
    bid_basket_item = self.bids.get(pk=bid_basket_item_id)
    if (not bid_basket_item.is_locked()):
        if (amount == 0):
            bid_basket_item.delete()
        else:
            bid_basket_item.amount = amount
            bid_basket_item.save()
        self.save()
    return bid_basket_item