Skip to content
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

Updating a zaaktype (PUT) raises an IntegrityError on gerelateerdeZaken #851

Closed
adriaanvanloon opened this issue Feb 4, 2021 · 1 comment · Fixed by #875
Closed

Updating a zaaktype (PUT) raises an IntegrityError on gerelateerdeZaken #851

adriaanvanloon opened this issue Feb 4, 2021 · 1 comment · Fixed by #875
Assignees
Labels
bug Something isn't working
Milestone

Comments

@adriaanvanloon
Copy link

Describe the bug
When we've already got a zaaktype on concept and we want to publish it (publicatieIndicatie set on true) we get an internal server error. The message in Open-Zaak log:

django.db.utils.IntegrityError: duplicate key value violates unique constraint "catalogi_zaaktypenrelati_zaaktype_id_gerelateerd__215fe641_uniq"
DETAIL: Key (zaaktype_id, gerelateerd_zaaktype)=(379, http://open-zaak.gemeentenet.local/catalogi/api/v1/zaaktypen/81256657-d7b1-4ddb-88de-054fccb0edfc) already exists.

It seems that we also need to update the attribute 'gerelateerdeZaaktypen'. Is this truly mandatory??? Can't we just keep the zaaktype the same and just publish it?

To Reproduce
Steps to reproduce the behavior:

  1. Insert a zaaktype and let it stay on concept
  2. Create a PUT call where you set the ' publicatieIndicatie' of the zaaktype of step 1 on true
  3. PUT the call to http://open-zaak.gemeentenet.local/catalogi/api/v1/zaaktypen/{uuid} (UUID of the zaaktype at step 1)

Expected behavior
A http status 200 with a message that the zaaktype is now published or een error where it says that you can't have the same value at the attribute 'gerelateerdeZaaktypen'

@adriaanvanloon adriaanvanloon added the bug Something isn't working label Feb 4, 2021
@sergei-maertens
Copy link
Member

Publishing a zaaktype is done by making a POST call to http://open-zaak.gemeentenet.local/catalogi/api/v1/zaaktypen/{uuid}/publish - not by toggling the publicatieIndicatie field (it has the meaning that zaken of that zaaktype should be published somewhere, not that the zaaktype itself is being published).

However, those integrity errors need to be looked into.

@sergei-maertens sergei-maertens changed the title Publishing a zaaktype creates a internal server error Updating a zaaktype (PUT) raises an IntegrityError on gerelateerdeZaken Feb 5, 2021
@sergei-maertens sergei-maertens added this to To do in Community support via automation Feb 14, 2021
@shea-maykinmedia shea-maykinmedia moved this from To do to In progress in Community support Feb 25, 2021
@shea-maykinmedia shea-maykinmedia self-assigned this Feb 25, 2021
shea-maykinmedia added a commit that referenced this issue Feb 25, 2021
@shea-maykinmedia shea-maykinmedia moved this from In progress to Implemented in Community support Mar 3, 2021
@sergei-maertens sergei-maertens added this to the Release 1.3.5 milestone Mar 8, 2021
shea-maykinmedia added a commit that referenced this issue Mar 12, 2021
Community support automation moved this from Implemented to Done Mar 18, 2021
sergei-maertens pushed a commit that referenced this issue Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants