mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-05 02:55:41 +00:00
Compare commits
No commits in common. "fe550317d2794287ac0cac2b14fad405320a4525" and "ad7781b5452c67fcf6a71e945c43a75f3292b1fc" have entirely different histories.
fe550317d2
...
ad7781b545
1 changed files with 3 additions and 1 deletions
|
|
@ -38,7 +38,9 @@ class AddStgPool(forms.Form):
|
|||
def clean_target(self):
|
||||
storage_type = self.cleaned_data["stg_type"]
|
||||
target = self.cleaned_data["target"]
|
||||
have_symbol = re.match("^[^-](\/?((?:[0-9a-zA-Z_])|(?:\.)|((?<!\/)-))*)+$", target)
|
||||
have_symbol = re.match("^[^-][a-zA-Z0-9/_-]+$", target) and not re.match(
|
||||
".*/-", target
|
||||
)
|
||||
if storage_type in ["dir", "netfs"] and not have_symbol:
|
||||
raise forms.ValidationError(
|
||||
_("The target must not contain any special characters")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue