summaryrefslogtreecommitdiff
path: root/releasenotes/notes
diff options
context:
space:
mode:
authorThomas Bracht Laumann Jespersen <t@laumann.xyz>2020-09-28 18:37:07 +0200
committerStephen Finucane <stephen@that.guru>2020-10-01 15:06:41 +0100
commitb7a6df90802738f729bae144bc618482d9fa6840 (patch)
treecbf64904bea96cf7b569178de8259f5da5579bc7 /releasenotes/notes
parent8f40045ff48235be2552ce2df16ba493b8b83af7 (diff)
downloadpatchwork-b7a6df90802738f729bae144bc618482d9fa6840.tar
patchwork-b7a6df90802738f729bae144bc618482d9fa6840.tar.gz
models: Validate Project.linkname does not contain forward slash
I started by creating a project that contained a forward slash (importing patches from https://lists.sr.ht/~sircmpwn/sr.ht-dev/) and it fails to render the "projects" main page. The specific error reads: NoReverseMatch at / Reverse for 'patch-list' with keyword arguments '{'project_id': 'foo/bar'}' not found. 1 pattern(s) tried: ['project/(?P<project_id>[^/]+)/list/$'] which appears to explicitly disallow forward slashes. So I think it makes sense to validate that project linkname doesn't contain forward slahes. This implementation uses the validate_unicode_slug validator instead of just rejecting inputs that contain forward slashes. Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #380
Diffstat (limited to 'releasenotes/notes')
-rw-r--r--releasenotes/notes/issue-380-68aaf6ee232209cc.yaml7
1 files changed, 7 insertions, 0 deletions
diff --git a/releasenotes/notes/issue-380-68aaf6ee232209cc.yaml b/releasenotes/notes/issue-380-68aaf6ee232209cc.yaml
new file mode 100644
index 0000000..db76038
--- /dev/null
+++ b/releasenotes/notes/issue-380-68aaf6ee232209cc.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ Previously, it was possible to create a project with a ``linkname``
+ containing invalid URL characters. This would result in broken URLs. We
+ now validate this field and restrict characters to unicode slugs (unicode
+ letters, numbers, underscores and hyphens).