Added by firstname.lastname@example.org 4 months 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().