As a plugin developer, I have the Artifacts checked at pre-save time against the ALLOWED_CONTENT_CHECKSUMS instead of at __init__
Right now the Artifact.init checks to see if checksums that are not allowed are being used and raises an error. That happens here.
This is has a problem when plugin code (like in pulp_rpm for example) does this:
foo = Artifact() foo.md5 = 'somemd5string' foo.save()
Move the checking currently in
Artifact.__init__ to a Artifact.pre_save hook using django-lifecycle.
Add a property to each of the checksums on Artifact that checks if it was set post construction by init. This keeps the check in two places and it's more code to carry/maintain. These downsides make it the alternative.
Please register to edit this issue