Minor fix for #2567

This commit is contained in:
Unknwon 2016-02-14 20:07:42 -05:00
parent daa43cfb6e
commit a1d97e8f5c
8 changed files with 17 additions and 14 deletions

View file

@ -13,7 +13,6 @@ watch_dirs = [
watch_exts = [".go"] watch_exts = [".go"]
build_delay = 1500 build_delay = 1500
cmds = [ cmds = [
["go", "install", "-v", "-race"], # sqlite cert pam tidb ["make", "build-dev"], # sqlite cert pam tidb
["go", "build", "-race"],
["./gogs", "web"] ["./gogs", "web"]
] ]

View file

@ -19,6 +19,10 @@ build: $(GENERATED)
go install -v -ldflags '$(LDFLAGS)' -tags '$(TAGS)' go install -v -ldflags '$(LDFLAGS)' -tags '$(TAGS)'
cp '$(GOPATH)/bin/gogs' . cp '$(GOPATH)/bin/gogs' .
build-dev: $(GENERATED)
go install -v -race -tags '$(TAGS)'
cp '$(GOPATH)/bin/gogs' .
govet: govet:
go tool vet -composites=false -methods=false -structtags=false . go tool vet -composites=false -methods=false -structtags=false .

View file

@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
##### Current version: 0.8.34 ##### Current version: 0.8.35
| Web | UI | Preview | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

View file

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.8.34.0214" const APP_VER = "0.8.35.0214"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View file

@ -593,16 +593,16 @@ func MergePullRequestAction(actUser *User, repo *Repository, pull *Issue) error
} }
// GetFeeds returns action list of given user in given context. // GetFeeds returns action list of given user in given context.
// ctxUserID is the user who's requesting, userID is the user/org that is requested. // userID is the user who's requesting, ctxUserID is the user/org that is requested.
// ctxUserID can be -1, if isProfile is true or in order to skip the permission check. // userID can be -1, if isProfile is true or in order to skip the permission check.
func GetFeeds(ctxUserID, userID, offset int64, isProfile bool) ([]*Action, error) { func GetFeeds(ctxUserID, userID, offset int64, isProfile bool) ([]*Action, error) {
actions := make([]*Action, 0, 20) actions := make([]*Action, 0, 20)
sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", userID) sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", ctxUserID)
if isProfile { if isProfile {
sess.And("is_private=?", false).And("act_user_id=?", userID) sess.And("is_private=?", false).And("act_user_id=?", ctxUserID)
} else if ctxUserID != -1 { } else if ctxUserID != -1 {
ctxUser := &User{Id: userID} ctxUser := &User{Id: ctxUserID}
if err := ctxUser.GetUserRepositories(ctxUserID); err != nil { if err := ctxUser.GetUserRepositories(userID); err != nil {
return nil, err return nil, err
} }

View file

@ -140,7 +140,7 @@ func Dashboard(ctx *middleware.Context) {
ctx.Data["MirrorCount"] = len(mirrors) ctx.Data["MirrorCount"] = len(mirrors)
ctx.Data["Mirrors"] = mirrors ctx.Data["Mirrors"] = mirrors
retrieveFeeds(ctx, ctx.User.Id, ctxUser.Id, 0, false) retrieveFeeds(ctx, ctxUser.Id, ctx.User.Id, 0, false)
if ctx.Written() { if ctx.Written() {
return return
} }

View file

@ -86,7 +86,7 @@ func Profile(ctx *middleware.Context) {
ctx.Data["TabName"] = tab ctx.Data["TabName"] = tab
switch tab { switch tab {
case "activity": case "activity":
retrieveFeeds(ctx, -1, u.Id, 0, true) retrieveFeeds(ctx, u.Id, -1, 0, true)
if ctx.Written() { if ctx.Written() {
return return
} }

View file

@ -1 +1 @@
0.8.34.0214 0.8.35.0214