1
0

GetUser now returns a pointer (#93)

This commit is contained in:
konrad
2019-08-14 19:59:31 +00:00
committed by Gitea
parent 8fbe721453
commit be14634e1e
25 changed files with 172 additions and 131 deletions

View File

@ -34,7 +34,7 @@ type Namespace struct {
OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
// The user who owns this namespace
Owner User `xorm:"-" json:"owner" valid:"-"`
Owner *User `xorm:"-" json:"owner" valid:"-"`
// A unix timestamp when this namespace was created. You cannot change this value.
Created int64 `xorm:"created not null" json:"created"`
@ -148,7 +148,7 @@ func (n *Namespace) ReadAll(search string, a web.Auth, page int) (interface{}, e
// Create our pseudo-namespace to hold the shared lists
// We want this one at the beginning, which is why we create it here
pseudonamespace := PseudoNamespace
pseudonamespace.Owner = *doer
pseudonamespace.Owner = doer
all = append(all, &NamespaceWithLists{
pseudonamespace,
[]*List{},
@ -238,7 +238,7 @@ func (n *Namespace) ReadAll(search string, a web.Auth, page int) (interface{}, e
// Users
for _, u := range users {
if n.OwnerID == u.ID {
all[i].Owner = *u
all[i].Owner = u
break
}
}