mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
forms: fix validation of repository URLs in layer edit form
Anchor the regex so it must match the entire string, and disallow spaces. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
e4c6844c50
commit
f10c4db361
|
@ -128,7 +128,7 @@ class EditLayerForm(StyledModelForm):
|
|||
|
||||
def clean_vcs_url(self):
|
||||
url = self.cleaned_data['vcs_url'].strip()
|
||||
val = RegexValidator(regex=r'[a-z]+://.*', message='Please enter a valid repository URL, e.g. git://server.name/path')
|
||||
val = RegexValidator(regex=r'^[a-z]+://[^ ]+$', message='Please enter a valid repository URL, e.g. git://server.name/path')
|
||||
val(url)
|
||||
return url
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user