Skip to content

Prevent empty WorkerConfiguration names

Erwan Rouchet requested to merge non-empty-config-name into master

Closes #1808 (closed)

I first tried adding a MinLengthValidator, but its validation does not apply when creating instances with the ORM directly; this only impacts the API (which already enforced non-empty config names) and the Django admin (same, since it does not have blank=True). I left it there because it doesn't cause any trouble, and added a CHECK constraint instead, which is the only way to really ensure names cannot be empty.

I spent some time analyzing every other text field and found many other cases where they could be empty. For example, ImageServer.objects.create() works just fine, and creates a server with no name and no URL. I will file issues to deal with that later.

Merge request reports

Loading