From 90656d3b171376a26162070230067a565b48cc23 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 27 Mar 2019 14:28:28 +0000 Subject: Validate name of dataset --- app/admin/datasets.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/admin') diff --git a/app/admin/datasets.py b/app/admin/datasets.py index 1403244..5b10dc4 100644 --- a/app/admin/datasets.py +++ b/app/admin/datasets.py @@ -33,6 +33,7 @@ Author: Gertjan van den Burg """ +import re import json import hashlib @@ -53,6 +54,9 @@ def validate_dataset(filename): if not key in data: return "Required key missing: %s" % key + if not re.fullmatch("\w+", data['name']): + return "Name can only contain characters in the set [a-zA-Z0-9_]" + if len(data["series"]) != data["n_dim"]: return "Number of dimensions and number of series don't match" -- cgit v1.2.3