Skip to content

ProtectedError at /api/specify/borrow/1365/ when deleting borrow #2511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
grantfitzsimmons opened this issue Nov 29, 2022 · 5 comments
Open
Assignees
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system todo:verify Needs Verification

Comments

@grantfitzsimmons
Copy link
Member

ProtectedError at /api/specify/borrow/1365/
("Cannot delete some instances of model 'Addressofrecord' because they are referenced through a protected foreign key: 'Borrow.addressofrecord'", <QuerySet [<Borrow: Borrow object (143)>, <Borrow: Borrow object (417)>, <Borrow: Borrow object (722)>, <Borrow: Borrow object (795)>, <Borrow: Borrow object (808)>, <Borrow: Borrow object (859)>, <Borrow: Borrow object (869)>, <Borrow: Borrow object (870)>, <Borrow: Borrow object (954)>, <Borrow: Borrow object (1012)>, <Borrow: Borrow object (1025)>, <Borrow: Borrow object (1092)>, <Borrow: Borrow object (1245)>, <Borrow: Borrow object (1315)>, <Borrow: Borrow object (1334)>, <Borrow: Borrow object (1420)>, <Borrow: Borrow object (1519)>, <Borrow: Borrow object (1585)>, <Borrow: Borrow object (1660)>, <Borrow: Borrow object (1685)>, '...(remaining elements truncated)...']>)

RBGE reports being unable to delete this record due to the above error.

https://herbrbge-edge.test.specifysystems.org/specify/view/borrow/1365/

Specify 7 Crash Report - 2022-11-29T21_41_04.770Z.txt

@grantfitzsimmons grantfitzsimmons added 1 - Bug Incorrect behavior of the product pri:unknown labels Nov 29, 2022
@maxpatiiuk
Copy link
Member

Back-end bug.

FYI for new developers:

There is a /api/delete_blockers/ endpoint that tells front-end if a given resource can be deleted, or if some other resource depends on it.

That endpoint returns no blockers for this record:
https://herbrbge-edge.test.specifysystems.org/api/delete_blockers/borrow/1365/

Need to figure out why it doesn't report this dependency as a delete blocker

@maxpatiiuk
Copy link
Member

Until then, a workaround is to manually delete the related records or make them reference a different borrow record.

@grantfitzsimmons
Copy link
Member Author

melton-jason added a commit that referenced this issue Jan 29, 2023
@grantfitzsimmons grantfitzsimmons moved this to 🏗 In progress in Back-End Backlog Feb 14, 2023
@grantfitzsimmons grantfitzsimmons added 2 - Forms Issues that are related to the form system and removed Unsorted labels Jul 2, 2023
@grantfitzsimmons
Copy link
Member Author

@melton-jason was this solved by #2929?

@melton-jason
Copy link
Contributor

This should not have been solved by #2929.
This should be fixed in #2806 (even if it is not fixed currently on that branch).

#2929 should have only improved this error message (and ones like it).

@emenslin emenslin added the todo:verify Needs Verification label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system todo:verify Needs Verification
Projects
Status: 🏗 In progress
Development

No branches or pull requests

4 participants