Source code for autodonate.admin

"""Register some tables to the admin panel."""
from django.contrib import admin
from structlog.stdlib import get_logger

from autodonate.models import Config

[docs]log = get_logger()
@admin.register(Config)
[docs]class ConfigAdmin(admin.ModelAdmin): """Admin Config model."""
[docs] def has_add_permission(self, request, obj=None): """Disable add action.""" log.debug("ConfigAdmin.has_add_permission", request=request, obj=obj) return False
[docs] def has_delete_permission(self, request, obj=None): """Disable delete.""" log.debug("ConfigAdmin.has_delete_permission", request=request, obj=obj) return False