For #1173, check if related field is required and don't allow it to be deleted