Added by bmbouter almost 2 years ago
Make an Artifact from a PulpTemporaryUploadedFile
Adds the Artifact.create_and_validate staticmethod that creates an in-memory, unsaved Artifact from a PulpTemporaryUploadedFile. Uploaded files to Pulp show up with that type so that is convenient for plugin writers. Also as the file is received by Django it auto-computes all of the digest types.
This PR also moves SizeValidationError and DigestValidation error to pulpcore.exceptions instead of living in pulpcore.plugin.downloads.
The ArtifactSerializer is also exposed via the plugin API with this change also.