Browse Source

models/user: handle case when user doesn't belong to any organization (#4258)

pull/4264/head
Unknwon 8 years ago
parent
commit
bab448681d
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      gogs.go
  2. 3
      models/user.go
  3. 2
      templates/.VERSION

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.10.9.0308"
const APP_VER = "0.10.10.0308"
func init() {
setting.AppVer = APP_VER

3
models/user.go

@ -453,6 +453,9 @@ func (u *User) GetOrganizations(showPrivate bool) error {
if err != nil {
return fmt.Errorf("GetOrgIDsByUserID: %v", err)
}
if len(orgIDs) == 0 {
return nil
}
u.Orgs = make([]*User, 0, len(orgIDs))
if err = x.In("id", orgIDs).Find(&u.Orgs); err != nil {

2
templates/.VERSION

@ -1 +1 @@
0.10.9.0308
0.10.10.0308
Loading…
Cancel
Save