Skip to content

Applying a template on a process that already has the template's versions can cause IntegrityError

  1. Create a process
  2. Add a worker version on that process
  3. Create a template from that process
  4. Apply that template back onto the original process

This causes an IntegrityError because the endpoint tries to create a WorkerRun that violates the dataimport_id, worker_version_id unique constraint.

To discuss before implementing anything:

  • Should the endpoint just delete all the existing worker runs and overwrite everything with the template?
  • Should applying a template fail when there would be duplicates?
  • Should applying a template ignore worker versions that already exist?