Fixed lint
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
087252f476
commit
09a02f9c18
|
@ -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 ""
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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 = ""
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue