mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-22 12:13:05 +00:00
26 lines
755 B
Python
26 lines
755 B
Python
__package__ = 'archivebox.workers'
|
|
|
|
import abx
|
|
|
|
from django.contrib.auth import get_permission_codename
|
|
|
|
from huey_monitor.apps import HueyMonitorConfig
|
|
from huey_monitor.admin import TaskModel, TaskModelAdmin, SignalInfoModel, SignalInfoModelAdmin
|
|
|
|
|
|
HueyMonitorConfig.verbose_name = 'Background Workers'
|
|
|
|
|
|
class CustomTaskModelAdmin(TaskModelAdmin):
|
|
actions = ["delete_selected"]
|
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
codename = get_permission_codename("delete", self.opts)
|
|
return request.user.has_perm("%s.%s" % (self.opts.app_label, codename))
|
|
|
|
|
|
|
|
@abx.hookimpl
|
|
def register_admin(admin_site):
|
|
admin_site.register(TaskModel, CustomTaskModelAdmin)
|
|
admin_site.register(SignalInfoModel, SignalInfoModelAdmin)
|