Update model to int64 Made value null by default Updated tests to not set by default Updated Swagger documents
This commit is contained in:
parent
e8135dcf75
commit
302064b4bb
@ -22,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
type users20210527105701 struct {
|
||||
DefaultListForNewTasks int `xorm:"int default 1 index" json:"-"`
|
||||
DefaultListID int64 `xorm:"bigint null index" json:"-"`
|
||||
}
|
||||
|
||||
func (users20210527105701) TableName() string {
|
||||
|
@ -75,7 +75,6 @@ func TestLabelTask_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
|
@ -55,7 +55,6 @@ func TestLabel_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -106,7 +105,6 @@ func TestLabel_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
@ -172,7 +170,6 @@ func TestLabel_ReadOne(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -234,7 +231,6 @@ func TestLabel_ReadOne(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
|
@ -184,7 +184,6 @@ func TestListUser_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
@ -198,7 +197,6 @@ func TestListUser_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
|
@ -183,7 +183,6 @@ func TestNamespaceUser_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
@ -197,7 +196,6 @@ func TestNamespaceUser_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
},
|
||||
|
@ -38,7 +38,6 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -49,7 +48,6 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -61,7 +59,6 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
IsActive: true,
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -44,7 +43,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -56,7 +54,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -69,7 +66,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -82,7 +78,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -94,7 +89,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -107,7 +101,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
EmailRemindersEnabled: true,
|
||||
DiscoverableByEmail: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -119,7 +112,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -131,7 +123,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -143,7 +134,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -156,7 +146,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -170,7 +159,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
EmailRemindersEnabled: true,
|
||||
DiscoverableByName: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
@ -182,7 +170,6 @@ func TestListUsersFromList(t *testing.T) {
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
DefaultListForNewTasks: 1,
|
||||
Created: testCreatedTime,
|
||||
Updated: testUpdatedTime,
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ type UserSettings struct {
|
||||
OverdueTasksRemindersEnabled bool `json:"overdue_tasks_reminders_enabled"`
|
||||
// If a task is created without a specified list this value should be used. Applies
|
||||
// to tasks made directly in API and from clients.
|
||||
DefaultListForNewTasks int `json:"default_list_for_new_tasks"`
|
||||
DefaultListID int64 `json:"default_list_id"`
|
||||
}
|
||||
|
||||
// GetUserAvatarProvider returns the currently set user avatar
|
||||
@ -173,7 +173,7 @@ func UpdateGeneralUserSettings(c echo.Context) error {
|
||||
user.DiscoverableByEmail = us.DiscoverableByEmail
|
||||
user.DiscoverableByName = us.DiscoverableByName
|
||||
user.OverdueTasksRemindersEnabled = us.OverdueTasksRemindersEnabled
|
||||
user.DefaultListForNewTasks = us.DefaultListForNewTasks
|
||||
user.DefaultListID = us.DefaultListID
|
||||
|
||||
_, err = user2.UpdateUser(s, user)
|
||||
if err != nil {
|
||||
|
@ -68,7 +68,7 @@ func UserShow(c echo.Context) error {
|
||||
DiscoverableByName: u.DiscoverableByName,
|
||||
DiscoverableByEmail: u.DiscoverableByEmail,
|
||||
OverdueTasksRemindersEnabled: u.OverdueTasksRemindersEnabled,
|
||||
DefaultListForNewTasks: u.DefaultListForNewTasks,
|
||||
DefaultListID: u.DefaultListID,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -8556,7 +8556,7 @@ var doc = `{
|
||||
"v1.UserSettings": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_list_for_new_tasks": {
|
||||
"default_list_id": {
|
||||
"description": "If a task is created without a specified list this value should be used. Applies\nto tasks made directly in API and from clients.",
|
||||
"type": "integer"
|
||||
},
|
||||
|
@ -8539,7 +8539,7 @@
|
||||
"v1.UserSettings": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_list_for_new_tasks": {
|
||||
"default_list_id": {
|
||||
"description": "If a task is created without a specified list this value should be used. Applies\nto tasks made directly in API and from clients.",
|
||||
"type": "integer"
|
||||
},
|
||||
|
@ -1178,7 +1178,7 @@ definitions:
|
||||
type: object
|
||||
v1.UserSettings:
|
||||
properties:
|
||||
default_list_for_new_tasks:
|
||||
default_list_id:
|
||||
description: |-
|
||||
If a task is created without a specified list this value should be used. Applies
|
||||
to tasks made directly in API and from clients.
|
||||
|
@ -67,11 +67,11 @@ type User struct {
|
||||
Issuer string `xorm:"text null" json:"-"`
|
||||
Subject string `xorm:"text null" json:"-"`
|
||||
|
||||
EmailRemindersEnabled bool `xorm:"bool default true" json:"-"`
|
||||
DiscoverableByName bool `xorm:"bool default false index" json:"-"`
|
||||
DiscoverableByEmail bool `xorm:"bool default false index" json:"-"`
|
||||
OverdueTasksRemindersEnabled bool `xorm:"bool default true index" json:"-"`
|
||||
DefaultListForNewTasks int `xorm:"int default 1 index" json:"-"`
|
||||
EmailRemindersEnabled bool `xorm:"bool default true" json:"-"`
|
||||
DiscoverableByName bool `xorm:"bool default false index" json:"-"`
|
||||
DiscoverableByEmail bool `xorm:"bool default false index" json:"-"`
|
||||
OverdueTasksRemindersEnabled bool `xorm:"bool default true index" json:"-"`
|
||||
DefaultListID int64 `xorm:"bigint null index" json:"-"`
|
||||
|
||||
// A timestamp when this task was created. You cannot change this value.
|
||||
Created time.Time `xorm:"created not null" json:"created"`
|
||||
@ -372,7 +372,7 @@ func UpdateUser(s *xorm.Session, user *User) (updatedUser *User, err error) {
|
||||
"discoverable_by_name",
|
||||
"discoverable_by_email",
|
||||
"overdue_tasks_reminders_enabled",
|
||||
"default_list_for_new_tasks",
|
||||
"default_list_id",
|
||||
).
|
||||
Update(user)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user