Commit f22a29a5 authored by Alexander Færøy's avatar Alexander Færøy 🍍
Browse files

Add delete action and show approved in the list view.

parent b36bd585
......@@ -30,11 +30,17 @@ def approve(modeladmin, request, queryset):
approve.short_description = "Approve account requests"
def delete(modeladmin, request, queryset):
for item in queryset:
item.delete()
delete.short_description = "Delete account requests"
@admin.register(GitlabAccountRequest)
class GitlabAccountRequestAdmin(admin.ModelAdmin):
fields = ('username', 'email', 'approved')
list_display = ('username', 'email')
actions = [approve]
list_display = ('username', 'email', 'approved')
actions = [approve, delete]
def has_delete_permission(self, request, obj=None):
return False
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