Do not require login_name & source_id for /admin/user/{username}
When editing a user via the API, do not require setting `login_name` or `source_id`: for local accounts, these do not matter. However, when editing a non-local account, require *both*, as before. Fixes #1861. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
787bc6ed94
commit
d07c8c821c
5 changed files with 56 additions and 33 deletions
|
@ -30,10 +30,8 @@ type CreateUserOption struct {
|
|||
|
||||
// EditUserOption edit user options
|
||||
type EditUserOption struct {
|
||||
// required: true
|
||||
SourceID int64 `json:"source_id"`
|
||||
// required: true
|
||||
LoginName string `json:"login_name" binding:"Required"`
|
||||
SourceID *int64 `json:"source_id"`
|
||||
LoginName *string `json:"login_name"`
|
||||
// swagger:strfmt email
|
||||
Email *string `json:"email" binding:"MaxSize(254)"`
|
||||
FullName *string `json:"full_name" binding:"MaxSize(100)"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue