con2 / con2/kompassi

Add pattern validation to slug fields

Open
#401 0 comments 0 reactions 0 assignees View on GitHub
good first issue typescript
Dominant language
Python
Stars
29
Forks
33
Avg merge
1d 22h
Merged PRs (30d)
19

Description

At least in

* survey slugs (dash)
* dimension slugs (underscore)
* dimension value slugs (underscore)
* form field slugs

Currently this is the validator used in backend:

https://github.com/con2/kompassi/blob/69c3418ab4da651f6eab9c2890c60076b29f7623/backend/core/utils/model_utils.py#L9-L12

However, this is not validated on the forms, causing a GraphQL error and #399.

Add a similar pattern validator in the frontend to the inputs that convey slugs.

Also the backend validator is shit and does substring match or something else that is fucked up. For example `ooh-tukilomake ` including the space is a valid survey slug according.

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.