Add delete admin option

This commit is contained in:
Andrew Godwin 2023-01-19 10:14:02 -07:00
parent a7be3b2072
commit 9b5152723a
1 changed files with 6 additions and 1 deletions

View File

@ -124,11 +124,16 @@ class IdentityAdmin(admin.ModelAdmin):
)
return super().get_search_results(request, queryset, search_term)
@admin.action(description="Force Update")
@admin.action(description="Force update")
def force_update(self, request, queryset):
for instance in queryset:
instance.transition_perform("outdated")
@admin.action(description="Mark as deleted")
def delete(self, request, queryset):
for instance in queryset:
instance.transition_perform("deleted")
@admin.display(description="ActivityPub JSON")
def actor_json(self, instance):
return instance.to_ap()