summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index d97ced931a..0b6063fbc9 100644
--- a/models/user.go
+++ b/models/user.go
@@ -107,6 +107,9 @@ type User struct {
NumMembers int
Teams []*Team `xorm:"-"`
Members []*User `xorm:"-"`
+
+ // Preferences
+ DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
}
func (u *User) BeforeInsert() {
@@ -126,6 +129,11 @@ func (u *User) SetLastLogin() {
u.LastLoginUnix = time.Now().Unix()
}
+func (u *User) UpdateDiffViewStyle(style string) error {
+ u.DiffViewStyle = style
+ return UpdateUser(u)
+}
+
func (u *User) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "full_name":