0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 15:53:07 -05:00

[GITEA] Fix required error for token name

- Say to the binding middleware which locale should be used for the
required error.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1683

(cherry picked from commit 64faeb6bef)
This commit is contained in:
Gusted 2023-11-02 12:21:14 +01:00 committed by Earl Warren
parent b8b3f6ab8b
commit e65acf3baf
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -365,7 +365,7 @@ func (f *EditVariableForm) Validate(req *http.Request, errs binding.Errors) bind
// NewAccessTokenForm form for creating access token // NewAccessTokenForm form for creating access token
type NewAccessTokenForm struct { type NewAccessTokenForm struct {
Name string `binding:"Required;MaxSize(255)"` Name string `binding:"Required;MaxSize(255)" locale:"settings.token_name"`
Scope []string Scope []string
} }