Project

Profile

Help

« Previous | Next » 

Revision 8dcdcd2d

Added by dkliban@redhat.com about 1 year ago

Handles duplicate content in the stages API.

If the very first Content in a batch has already been prefetched in a previous call to prefetch_related_objects, Django does not set the attribute specified in 'to_attr' when prefetching the rest of the items in the batch. As a result, the '_remote_artifact_saver_cas' attribute is not set on the Content instances and AttributeError is raised when '_remote_artifact_saver_cas' is accessed by the RemoteArtifactSaverStage.

This patch removes any existing '_remote_artifact_saver_cas' attributes on Content before calling into Django's prefetch_related_objects().

fixes: #7147 https://pulp.plan.io/issues/7147