Project

Profile

Help

« Previous | Next » 

Revision 7129d7ef

Added by pulpbot almost 2 years ago

Avoid superfluous RepositoryContent records (#487)

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)

Co-authored-by: gmbnomis