diff --git a/pkg/models/label_task_test.go b/pkg/models/label_task_test.go index dd5afb04a..38375e366 100644 --- a/pkg/models/label_task_test.go +++ b/pkg/models/label_task_test.go @@ -50,7 +50,7 @@ func TestLabelTask_ReadAll(t *testing.T) { ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", // hash for "" + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", // hash for "" }, }, }, diff --git a/pkg/models/label_test.go b/pkg/models/label_test.go index db55b8a53..9fd2810c3 100644 --- a/pkg/models/label_test.go +++ b/pkg/models/label_test.go @@ -48,7 +48,7 @@ func TestLabel_ReadAll(t *testing.T) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", } tests := []struct { name string @@ -89,7 +89,7 @@ func TestLabel_ReadAll(t *testing.T) { ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", }, }, }, @@ -144,7 +144,7 @@ func TestLabel_ReadOne(t *testing.T) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", } tests := []struct { name string @@ -199,7 +199,7 @@ func TestLabel_ReadOne(t *testing.T) { ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", }, }, auth: &User{ID: 1}, diff --git a/pkg/models/list_task_readall_test.go b/pkg/models/list_task_readall_test.go index a86a03a3f..9c87104ca 100644 --- a/pkg/models/list_task_readall_test.go +++ b/pkg/models/list_task_readall_test.go @@ -21,20 +21,20 @@ func sortTasksForTesting(by SortBy) (tasks []*ListTask) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", // hash for "" + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", // hash for "" } user2 := User{ ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", // hash for "" + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", // hash for "" } user6 := User{ ID: 6, Username: "user6", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "3efbe51f864c6666bc27caf4c6ff90ed", // hash for "" + AvatarURL: "3efbe51f864c6666bc27caf4c6ff90ed", // hash for "" } tasks = []*ListTask{ @@ -350,7 +350,7 @@ func TestListTask_ReadAll(t *testing.T) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", // hash for "" + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", // hash for "" } type fields struct { diff --git a/pkg/models/list_users_test.go b/pkg/models/list_users_test.go index 23774841b..2b94e7ef9 100644 --- a/pkg/models/list_users_test.go +++ b/pkg/models/list_users_test.go @@ -164,7 +164,7 @@ func TestListUser_ReadAll(t *testing.T) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", }, Right: RightRead, }, @@ -173,7 +173,7 @@ func TestListUser_ReadAll(t *testing.T) { ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", }, Right: RightRead, }, diff --git a/pkg/models/namespace_users_test.go b/pkg/models/namespace_users_test.go index 48813c25e..80d5ef9d6 100644 --- a/pkg/models/namespace_users_test.go +++ b/pkg/models/namespace_users_test.go @@ -163,7 +163,7 @@ func TestNamespaceUser_ReadAll(t *testing.T) { Username: "user1", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", IsActive: true, - AvatarUrl: "111d68d06e2d317b5a59c2c6c5bad808", + AvatarURL: "111d68d06e2d317b5a59c2c6c5bad808", }, Right: RightRead, }, @@ -172,7 +172,7 @@ func TestNamespaceUser_ReadAll(t *testing.T) { ID: 2, Username: "user2", Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", - AvatarUrl: "ab53a2911ddf9b4817ac01ddcd3d975f", + AvatarURL: "ab53a2911ddf9b4817ac01ddcd3d975f", }, Right: RightRead, }, diff --git a/pkg/models/user.go b/pkg/models/user.go index 8bfaaaf97..6eeb377af 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -48,7 +48,7 @@ type User struct { Email string `xorm:"varchar(250) null" json:"email,omitempty" valid:"email,length(0|250)" maxLength:"250"` IsActive bool `xorm:"null" json:"-"` // The users md5-hashed email address, used to get the avatar from gravatar and the likes - AvatarUrl string `xorm:"-" json:"avatarUrl"` + AvatarURL string `xorm:"-" json:"avatarUrl"` PasswordResetToken string `xorm:"varchar(450) null" json:"-"` EmailConfirmToken string `xorm:"varchar(450) null" json:"-"` @@ -63,7 +63,7 @@ type User struct { // AfterLoad is used to delete all emails to not have them leaked to the user func (u *User) AfterLoad() { - u.AvatarUrl = utils.Md5String(u.Email) + u.AvatarURL = utils.Md5String(u.Email) u.Email = "" }