Project

Profile

Help

« Previous | Next » 

Revision c5a887fa

Added by gmbnomis 9 months ago

  • ID c5a887fa6f174f44e1452ed45b2aadde9e15abf2
  • Parent bca447bd

Avoid superfluous RepositoryContent records

When adding and removing the same content in a repository version, don't update the RepositoryContent record (resulting in an superfluous RepositoryContent for which version_added == version_removed == current version). Instead, just delete the existing record. This fixes two problems:

  1. Such content is shown as added and removed.
  2. Re-adding the content again in the same version leads to a IntegrityError because the uniqueness constraint is violated.

Handle the "remove then re-add" case analogously.

https://pulp.plan.io/issues/5707 closes #5707

(cherry picked from commit 96b76e0687ac52e8bc68751ec414c9b6b4501dc2)