mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-03-13 05:41:37 +00:00
pyi2phosts/postkey/admin.py: add admin action "Approve selected"
This commit is contained in:
parent
70b7585e54
commit
49e084189d
@ -45,9 +45,12 @@ class PendingAdmin(i2phostAdmin):
|
||||
qs = super(PendingAdmin, self).queryset(request)
|
||||
return qs.filter(approved=False)
|
||||
|
||||
def approve_selected(modeladmin, request, queryset):
|
||||
queryset.update(approved=True)
|
||||
|
||||
list_filter = []
|
||||
list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires', 'approved')
|
||||
list_editable = ['approved']
|
||||
actions = ['approve_selected']
|
||||
|
||||
|
||||
admin.site.register(i2phost, i2phostAdmin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user