Skip to content

Commit

Permalink
Fix required error for token name (go-gitea#28267)
Browse files Browse the repository at this point in the history
- 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 5a2d7966127b5639332038e9925d858ab54fc360)

Co-authored-by: Gusted <postmaster@gusted.xyz>
  • Loading branch information
2 people authored and silverwind committed Feb 20, 2024
1 parent 995c79d commit a940d89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/forms/user_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (f *EditVariableForm) Validate(req *http.Request, errs binding.Errors) bind

// NewAccessTokenForm form for creating access token
type NewAccessTokenForm struct {
Name string `binding:"Required;MaxSize(255)"`
Name string `binding:"Required;MaxSize(255)" locale:"settings.token_name"`
Scope []string
}

Expand Down

0 comments on commit a940d89

Please sign in to comment.