Skip to content

Commit 94ee71a

Browse files
committed
New admin action for Reports: recalculate
After doing a bulk upload of benchmarks, possibly not in chronological order, the reports might show changes wrt. to the wrong previous commit. Then, triggering this action for all reports helps.
1 parent 9ce652a commit 94ee71a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

codespeed/admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ class ResultAdmin(admin.ModelAdmin):
5757
admin.site.register(Result, ResultAdmin)
5858

5959

60+
def recalculate_report(modeladmin, request, queryset):
61+
for report in queryset:
62+
report.save()
63+
recalculate_report.short_description = "Recalculate reports"
64+
6065
class ReportAdmin(admin.ModelAdmin):
6166
list_display = ('revision', 'summary', 'colorcode')
6267
ordering = ['-revision']
68+
actions = [recalculate_report]
6369

6470
admin.site.register(Report, ReportAdmin)

0 commit comments

Comments
 (0)