Actions
Story #2984
closedAs an API user, I get user friendly feedback when I use an invalid value
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 27
Quarter:
Description
There are several places in Pulp 3 where we ought to be using validation but are not. Here are a few examples with reproducers:
https://pulp.plan.io/issues/2974
https://pulp.plan.io/issues/2975
https://pulp.plan.io/issues/2976
There may be more issues too. Instead of opening individual bugs/tasks, this story is go through the API and add validation for any existing fields that need it.
Related issues
Actions
Add uniquenessand length validators to serializer fields.
Move username regex validator from model to serializer, since the model validation does not run automatically on model save: https://docs.djangoproject.com/en/dev/ref/validators/#how-validators-are-run
Note: For the importer and publisher uniqueness validator to take effect they must be declared on the Plugin importer and publisher class like so:
Class PluginPublisherSerializer(pulpcore.plugin.serializers.PublisherSerializer): class Meta: validators = PublisherSerializer.Meta.validators
closes #2984 https://pulp.plan.io/issues/2984