In your view that handles the button press, check the status of the object before assigning it. If it’s already assigned, do what you need to do in that situation.
In the simple case, this is going to cover 99+% of what’s going to happen. If you need it to be even more precise, use the select_for_update
function to retrieve the row to be tested.
We can’t be more specific without seeing the view being used here.