« Previous | Next » 

Revision 96b76e06

Added by gmbnomis over 1 year ago

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. closes #5707