mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-16 10:25:05 +02:00
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)
|
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,
|
RequestedUser: ctxUser,
|
||||||
RequestedTeam: ctx.Org.Team,
|
RequestedTeam: ctx.Org.Team,
|
||||||
Actor: ctx.Doer,
|
Actor: ctx.Doer,
|
||||||
|
@ -21,9 +21,8 @@ func userFeedCacheKey(userID int64) string {
|
|||||||
return fmt.Sprintf("user_feed_%d", userID)
|
return fmt.Sprintf("user_feed_%d", userID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFeeds returns actions according to the provided options
|
func GetFeedsForDashboard(ctx context.Context, opts activities_model.GetFeedsOptions) (activities_model.ActionList, int64, error) {
|
||||||
func GetFeeds(ctx context.Context, opts activities_model.GetFeedsOptions) (activities_model.ActionList, int64, error) {
|
opts.DontCount = opts.RequestedTeam == nil && opts.Date == ""
|
||||||
opts.DontCount = opts.Actor != nil && opts.RequestedUser != nil && (opts.Actor.IsAdmin || opts.Actor.ID == opts.RequestedUser.ID)
|
|
||||||
results, cnt, err := activities_model.GetFeeds(ctx, opts)
|
results, cnt, err := activities_model.GetFeeds(ctx, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
@ -36,6 +35,11 @@ func GetFeeds(ctx context.Context, opts activities_model.GetFeedsOptions) (activ
|
|||||||
return results, cnt, err
|
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.
|
// notifyWatchers creates batch of actions for every watcher.
|
||||||
// It could insert duplicate actions for a repository action, like this:
|
// It could insert duplicate actions for a repository action, like this:
|
||||||
// * Original action: UserID=1 (the real actor), ActUserID=1
|
// * Original action: UserID=1 (the real actor), ActUserID=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user