CentreForDigitalHumanities / CentreForDigitalHumanities/Textcavator

Corpus form: field validation not run

Open
#1,864 1 comment 0 reactions 0 assignees View on GitHub
backend bug corpus-form
Dominant language
Python
Stars
12
Forks
3
Avg merge
3d 3m
Merged PRs (30d)
9

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.