|
|
@ -32,7 +32,6 @@ import ( |
|
|
|
"github.com/gogits/gogs/models/errors" |
|
|
|
"github.com/gogits/gogs/models/errors" |
|
|
|
"github.com/gogits/gogs/modules/avatar" |
|
|
|
"github.com/gogits/gogs/modules/avatar" |
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/gogits/gogs/modules/markdown" |
|
|
|
|
|
|
|
"github.com/gogits/gogs/modules/setting" |
|
|
|
"github.com/gogits/gogs/modules/setting" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -114,8 +113,6 @@ func (u *User) BeforeUpdate() { |
|
|
|
|
|
|
|
|
|
|
|
func (u *User) AfterSet(colName string, _ xorm.Cell) { |
|
|
|
func (u *User) AfterSet(colName string, _ xorm.Cell) { |
|
|
|
switch colName { |
|
|
|
switch colName { |
|
|
|
case "full_name": |
|
|
|
|
|
|
|
u.FullName = markdown.Sanitizer.Sanitize(u.FullName) |
|
|
|
|
|
|
|
case "created_unix": |
|
|
|
case "created_unix": |
|
|
|
u.Created = time.Unix(u.CreatedUnix, 0).Local() |
|
|
|
u.Created = time.Unix(u.CreatedUnix, 0).Local() |
|
|
|
case "updated_unix": |
|
|
|
case "updated_unix": |
|
|
@ -707,7 +704,6 @@ func updateUser(e Engine, u *User) error { |
|
|
|
u.Website = base.TruncateString(u.Website, 255) |
|
|
|
u.Website = base.TruncateString(u.Website, 255) |
|
|
|
u.Description = base.TruncateString(u.Description, 255) |
|
|
|
u.Description = base.TruncateString(u.Description, 255) |
|
|
|
|
|
|
|
|
|
|
|
u.FullName = markdown.Sanitizer.Sanitize(u.FullName) |
|
|
|
|
|
|
|
_, err := e.Id(u.ID).AllCols().Update(u) |
|
|
|
_, err := e.Id(u.ID).AllCols().Update(u) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|