Esempio n. 1
0
    def on_new_version(self, version):
        """
        Called when new repository versions are created.

        Args:
            version: The new repository version.
        """
        super().on_new_version(version)

        # avoid circular import issues
        from pulp_file.app import tasks

        if self.autopublish:
            tasks.publish(
                manifest=self.manifest,
                repository_version_pk=version.pk,
            )
Esempio n. 2
0
    def on_new_version(self, version):
        """
        Called when new repository versions are created.

        Args:
            version: The new repository version.
        """
        super().on_new_version(version)

        # avoid circular import issues
        from pulp_file.app import tasks

        if self.autopublish:
            publication = tasks.publish(
                manifest=self.manifest,
                repository_version_pk=version.pk,
            )

            distributions = self.distributions.all()

            if publication and distributions:
                for distribution in distributions:
                    distribution.publication = publication
                    distribution.save()