add pronoun field to user profiles
This commit is contained in:
parent
efd0f0f224
commit
f8e48e066a
11 changed files with 19 additions and 1 deletions
|
@ -218,6 +218,7 @@ type UpdateProfileForm struct {
|
|||
KeepEmailPrivate bool
|
||||
Website string `binding:"ValidSiteUrl;MaxSize(255)"`
|
||||
Location string `binding:"MaxSize(50)"`
|
||||
Pronouns string `binding:"MaxSize(50)"`
|
||||
Description string `binding:"MaxSize(255)"`
|
||||
Visibility structs.VisibleType
|
||||
KeepActivityPrivate bool
|
||||
|
|
|
@ -22,6 +22,7 @@ type UpdateOptions struct {
|
|||
Website optional.Option[string]
|
||||
Location optional.Option[string]
|
||||
Description optional.Option[string]
|
||||
Pronouns optional.Option[string]
|
||||
AllowGitHook optional.Option[bool]
|
||||
AllowImportLocal optional.Option[bool]
|
||||
MaxRepoCreation optional.Option[int]
|
||||
|
@ -54,6 +55,11 @@ func UpdateUser(ctx context.Context, u *user_model.User, opts *UpdateOptions) er
|
|||
|
||||
cols = append(cols, "full_name")
|
||||
}
|
||||
if opts.Pronouns.Has() {
|
||||
u.Pronouns = opts.Pronouns.Value()
|
||||
|
||||
cols = append(cols, "pronouns")
|
||||
}
|
||||
if opts.Website.Has() {
|
||||
u.Website = opts.Website.Value()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue