mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
20 lines
580 B
Python
20 lines
580 B
Python
from django.contrib import admin
|
|
from .models import RenderedContent, SiteSettings
|
|
|
|
|
|
@admin.register(RenderedContent)
|
|
class RenderedContentAdmin(admin.ModelAdmin):
|
|
list_display = ("cache_key", "content_type")
|
|
search_fields = ("cache_key",)
|
|
|
|
|
|
@admin.register(SiteSettings)
|
|
class SiteSettingsAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "wordcloud_ignore")
|
|
|
|
def has_add_permission(self, request):
|
|
return super().has_add_permission(request) and SiteSettings.objects.count() == 0
|
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
return False
|