Project

Profile

Help

« Previous | Next » 

Revision 50251ae5

ID50251ae5dab13fab533f173250ce083bcb3bf6fd
Parent d65d2d8c
Child cf77dc85

Added by bmbouter about 1 year 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.

https://pulp.plan.io/issues/4072
closes #4072