Skip to content

POST to /objecten with existing UUID raises 500 error #718

@stevenbal

Description

@stevenbal

Product versie / Product version

3.5.0 / latest

Omschrijf het probleem / Describe the bug

When attempting to do a POST to /objecten with a UUID that is already used by another object, a 500 error is raised

IntegrityError at /api/v2/objects
duplicate key value violates unique constraint "core_object_uuid_key"
DETAIL:  Key (uuid)=(289f65bc-e1c0-43f4-b2c4-e71181315f45) already exists.

Stappen om te reproduceren / Steps to reproduce

  1. Do a POST to /objecten to create an Object
  2. Do a second POST to /objecten and reuse the UUID from step 1
  3. Observe the internal server error

Verwacht gedrag / Expected behavior

In any case, Objects API should raise a 400 error a duplicate UUID is used.

I'm wondering though if it's intentional (or desirable) to let users specify UUIDs, this might have been an oversight?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions