mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 09:55:20 +02:00
#1585 order owners list by last changed time
This commit is contained in:
parent
36405d0faa
commit
3d9b98fae4
3 changed files with 32 additions and 3 deletions
|
@ -28,11 +28,12 @@ const (
|
|||
)
|
||||
|
||||
func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
|
||||
if err := ctx.User.GetOrganizations(); err != nil {
|
||||
ctx.Handle(500, "GetOrganizations", err)
|
||||
orgs, err := models.GetOwnedOrgsByUserIDDesc(ctx.User.Id, "updated")
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetOwnedOrganizationsByUserIDDesc", err)
|
||||
return nil
|
||||
}
|
||||
ctx.Data["Orgs"] = ctx.User.Orgs
|
||||
ctx.Data["Orgs"] = orgs
|
||||
|
||||
// Not equal means current user is an organization.
|
||||
if uid == ctx.User.Id || uid == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue