Mentions légales du service

Skip to content

add model constraints (mostly validators) and enforce them

BAIRE Anthony requested to merge validators into django

This PR adds many constraints to the models to improve the integrity and security (because some user-provided fields may contain dangerous values, eg: Webapp.docker_name, Job.param, ...)

Fixes #223 (closed)

The added constraint mainly consists of adding validators or removing blank=True or null=True when it is not meaningless to have an empty value.

There a few other changes:

  • JobQueue.is_default and WebappVersion.published were transformed into BooleanField (because they actually are boolean)
  • the sshkey validator was moved from the UserForm to the User model and rewritten to support the actual format supported by the ssh container
  • I relaxed the constraint on WebappVersion.url to make it optional (because i do not see a reason why we should mandate users to provide a url for every webapp version)
  • enforce model validation when creating a job via the API and when creating a Webapp
Edited by BAIRE Anthony

Merge request reports