Browse Source

Ordering team by name ascending except for 'Owners'

pull/3854/head
Thibault Meyer 8 years ago
parent
commit
247fe443be
No known key found for this signature in database
GPG Key ID: C52D76D2CCF24933
  1. 2
      models/org.go

2
models/org.go

@ -50,7 +50,7 @@ func (org *User) GetOwnerTeam() (*Team, error) {
}
func (org *User) getTeams(e Engine) error {
return e.Where("org_id=?", org.ID).Find(&org.Teams)
return e.Where("org_id=?", org.ID).OrderBy("CASE WHEN name LIKE '" + OWNER_TEAM + "' THEN '' ELSE name END").Find(&org.Teams)
}
// GetTeams returns all teams that belong to organization.

Loading…
Cancel
Save