Fix: test error / missing AfterFind hook in user model

This commit is contained in:
HFO4
2019-11-27 15:27:19 +08:00
parent 16067c3ac8
commit b3ef833afd
5 changed files with 30 additions and 10 deletions

View File

@@ -41,7 +41,7 @@ type Group struct {
// BuildUser 序列化用户
func BuildUser(user model.User) User {
fmt.Println(user)
aria2Option := user.Group.GetAria2Option()
return User{
ID: user.ID,
Email: user.Email,
@@ -58,8 +58,8 @@ func BuildUser(user model.User) User {
},
Group: Group{
AllowShare: user.Group.ShareEnabled,
AllowRemoteDownload: user.Group.Aria2Option[0] == '1',
AllowTorrentDownload: user.Group.Aria2Option[2] == '1',
AllowRemoteDownload: aria2Option[0],
AllowTorrentDownload: aria2Option[2],
},
}
}