Commit ae0c8b16 authored by Michal Čihař's avatar Michal Čihař

Add admin command to flush lazy commits

parent a86a37e9
......@@ -13,7 +13,7 @@ class SubProjectAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('name',)}
search_fields = ['name', 'slug', 'repo', 'branch']
list_filter = ['project']
actions = ['update_from_git', 'update_checks']
actions = ['update_from_git', 'update_checks', 'force_commit']
def update_from_git(self, request, queryset):
for s in queryset:
......@@ -27,6 +27,11 @@ class SubProjectAdmin(admin.ModelAdmin):
cnt += 1
self.message_user(request, "Updated checks for %d units." % cnt)
def force_commit(self, request, queryset):
for s in queryset:
s.check_commit_needed()
self.message_user(request, "Flushed changes in %d git repos." % queryset.count())
admin.site.register(SubProject, SubProjectAdmin)
class TranslationAdmin(admin.ModelAdmin):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment