From edf14202fea349500d69ed2a360a53cc0d1f80e3 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 12 Jun 2022 07:43:27 +0200 Subject: Unify repo settings & show better error (#19828) * Unify context data * Actually show invalid url in error --- modules/web/middleware/binding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/web/middleware/binding.go b/modules/web/middleware/binding.go index c9dc4a8f59..88a3920f6e 100644 --- a/modules/web/middleware/binding.go +++ b/modules/web/middleware/binding.go @@ -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: -- cgit v1.2.3