Skip to content

Corpus form: field validation not run #1864

@lukavdplas

Description

@lukavdplas

When you create a corpus using the corpus form, the validators for the Field model are never run. (This does not happen automatically when you use save() on a model instance, it would need to be explicitly called.)

Field contains two validators. One of these is a set of permitted characters; this is always met if you use the form, which will generate field names as slugs. The other is to check for overlap with forbidden field names; this can happen, and would lead to serious bugs when searching the corpus.

Solution:

  1. Field validators should be run when creating a corpus through the API.
  2. Ideally, this specific issue of forbidden names is avoided altogether. I'll make a separate issue for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendchanges to the django backendbugsomething isn't working right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions