mirror of https://github.com/go-gitea/gitea.git
Fix test
This commit is contained in:
parent
6658b8ec42
commit
ec86404f8d
|
@ -118,7 +118,7 @@ func Dashboard(ctx *context.Context) {
|
|||
ctx.Data["HeatmapTotalContributions"] = activities_model.GetTotalContributionsInHeatmap(data)
|
||||
}
|
||||
|
||||
feeds, count, err := feed_service.GetFeeds(ctx, activities_model.GetFeedsOptions{
|
||||
feeds, count, err := feed_service.GetFeedsForDashboard(ctx, activities_model.GetFeedsOptions{
|
||||
RequestedUser: ctxUser,
|
||||
RequestedTeam: ctx.Org.Team,
|
||||
Actor: ctx.Doer,
|
||||
|
|
|
@ -21,9 +21,8 @@ func userFeedCacheKey(userID int64) string {
|
|||
return fmt.Sprintf("user_feed_%d", userID)
|
||||
}
|
||||
|
||||
// GetFeeds returns actions according to the provided options
|
||||
func GetFeeds(ctx context.Context, opts activities_model.GetFeedsOptions) (activities_model.ActionList, int64, error) {
|
||||
opts.DontCount = opts.Actor != nil && opts.RequestedUser != nil && (opts.Actor.IsAdmin || opts.Actor.ID == opts.RequestedUser.ID)
|
||||
func GetFeedsForDashboard(ctx context.Context, opts activities_model.GetFeedsOptions) (activities_model.ActionList, int64, error) {
|
||||
opts.DontCount = opts.RequestedTeam == nil && opts.Date == ""
|
||||
results, cnt, err := activities_model.GetFeeds(ctx, opts)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
|
@ -36,6 +35,11 @@ func GetFeeds(ctx context.Context, opts activities_model.GetFeedsOptions) (activ
|
|||
return results, cnt, err
|
||||
}
|
||||
|
||||
// GetFeeds returns actions according to the provided options
|
||||
func GetFeeds(ctx context.Context, opts activities_model.GetFeedsOptions) (activities_model.ActionList, int64, error) {
|
||||
return activities_model.GetFeeds(ctx, opts)
|
||||
}
|
||||
|
||||
// notifyWatchers creates batch of actions for every watcher.
|
||||
// It could insert duplicate actions for a repository action, like this:
|
||||
// * Original action: UserID=1 (the real actor), ActUserID=1
|
||||
|
|
Loading…
Reference in New Issue