1
0
Fork 0
forked from forgejo/forgejo

Unify repo settings & show better error (#19828)

* Unify context data
* Actually show invalid url in error
This commit is contained in:
Gusted 2022-06-12 07:43:27 +02:00 committed by GitHub
parent 3898fc5bda
commit edf14202fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 14 deletions

View file

@ -128,7 +128,7 @@ func Validate(errs binding.Errors, data map[string]interface{}, f Form, l transl
case binding.ERR_EMAIL:
data["ErrorMsg"] = trName + l.Tr("form.email_error")
case binding.ERR_URL:
data["ErrorMsg"] = trName + l.Tr("form.url_error")
data["ErrorMsg"] = trName + l.Tr("form.url_error", errs[0].Message)
case binding.ERR_INCLUDE:
data["ErrorMsg"] = trName + l.Tr("form.include_error", GetInclude(field))
case validation.ErrGlobPattern: