From 36518bc0298d0c91669d9ab3a751705093af1f37 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 1 Dec 2021 10:02:10 +0100 Subject: [PATCH] Legacy API: fix exception when tags is not an array --- buildsrht/blueprints/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildsrht/blueprints/api.py b/buildsrht/blueprints/api.py index dc3f332..561e454 100644 --- a/buildsrht/blueprints/api.py +++ b/buildsrht/blueprints/api.py @@ -44,7 +44,7 @@ def jobs_POST(): write = valid.optional("access:write", [current_token.user.username], list) secrets = valid.optional("secrets", cls=bool, default=True) tags = valid.optional("tags", [], list) - valid.expect(all(re.match(r"^[A-Za-z0-9_.-]+$", tag) for tag in tags), + valid.expect(not valid.ok or all(re.match(r"^[A-Za-z0-9_.-]+$", tag) for tag in tags), "Invalid tag name, tags must use lowercase alphanumeric characters, underscores, dashes, or dots", field="tags") triggers = valid.optional("triggers", list(), list) -- 2.38.5