Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 9c4f648

Browse files
jolheiserappleboy
authored andcommitted
MustChangePassword must be nillable (#150)
In order to enforce the same as CLI (default MustChangePassword true), the form option must be nillable so that it can default to true.
1 parent 4a15722 commit 9c4f648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitea/admin_user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type CreateUserOption struct {
2323
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
2424
// required: true
2525
Password string `json:"password" binding:"Required;MaxSize(255)"`
26-
MustChangePassword bool `json:"must_change_password"`
26+
MustChangePassword *bool `json:"must_change_password"`
2727
SendNotify bool `json:"send_notify"`
2828
}
2929

@@ -46,7 +46,7 @@ type EditUserOption struct {
4646
// swagger:strfmt email
4747
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
4848
Password string `json:"password" binding:"MaxSize(255)"`
49-
MustChangePassword bool `json:"must_change_password"`
49+
MustChangePassword *bool `json:"must_change_password"`
5050
Website string `json:"website" binding:"MaxSize(50)"`
5151
Location string `json:"location" binding:"MaxSize(50)"`
5252
Active *bool `json:"active"`

0 commit comments

Comments
 (0)