diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-01-30 16:55:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-30 10:55:53 +0200 |
commit | 5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86 (patch) | |
tree | 519259f05f7e7fc4dd1df4da521e000ce469567b /modules/forms/admin.go | |
parent | 0e0424c8ecaf6fa3cdd1fcfc154f188014c63dd8 (diff) | |
download | gitea-5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86.tar.gz gitea-5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86.zip |
Move middlewares to web/middleware (#14480)
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/forms/admin.go')
-rw-r--r-- | modules/forms/admin.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/forms/admin.go b/modules/forms/admin.go index 09ad420e15..2e6bbaf172 100644 --- a/modules/forms/admin.go +++ b/modules/forms/admin.go @@ -8,7 +8,7 @@ import ( "net/http" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/middlewares" + "code.gitea.io/gitea/modules/web/middleware" "gitea.com/go-chi/binding" ) @@ -27,7 +27,7 @@ type AdminCreateUserForm struct { // Validate validates form fields func (f *AdminCreateUserForm) Validate(req *http.Request, errs binding.Errors) binding.Errors { ctx := context.GetContext(req) - return middlewares.Validate(errs, ctx.Data, f, ctx.Locale) + return middleware.Validate(errs, ctx.Data, f, ctx.Locale) } // AdminEditUserForm form for admin to create user @@ -54,7 +54,7 @@ type AdminEditUserForm struct { // Validate validates form fields func (f *AdminEditUserForm) Validate(req *http.Request, errs binding.Errors) binding.Errors { ctx := context.GetContext(req) - return middlewares.Validate(errs, ctx.Data, f, ctx.Locale) + return middleware.Validate(errs, ctx.Data, f, ctx.Locale) } // AdminDashboardForm form for admin dashboard operations @@ -66,5 +66,5 @@ type AdminDashboardForm struct { // Validate validates form fields func (f *AdminDashboardForm) Validate(req *http.Request, errs binding.Errors) binding.Errors { ctx := context.GetContext(req) - return middlewares.Validate(errs, ctx.Data, f, ctx.Locale) + return middleware.Validate(errs, ctx.Data, f, ctx.Locale) } |