8000 Register Placeholder model with admin (#6458) · django-cms/django-cms@5a1c893 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a1c893

Browse files
Aiky30czpython
authored andcommitted
Register Placeholder model with admin (#6458)
1 parent a9947fe commit 5a1c893

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cms/admin/placeholderadmin.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import warnings
44

55
from django.conf.urls import url
6+
from django.contrib import admin
67
from django.contrib.admin.helpers import AdminForm
78
from django.contrib.admin.utils import get_deleted_objects
89
from django.core.exceptions import PermissionDenied
@@ -1189,3 +1190,21 @@ def clear_placeholder(self, request, placeholder_id):
11891190
}
11901191
request.current_app = self.admin_site.name
11911192
return TemplateResponse(request, "admin/cms/page/plugin/delete_confirmation.html", context)
1193+
1194+
1195+
class PlaceholderAdmin(PlaceholderAdminMixin, admin.ModelAdmin):
1196+
1197+
def has_add_permission(self, request):
1198+
return False
1199+
1200+
def has_change_permission(self, request, obj=None):
1201+
return False
1202+
1203+
def has_delete_permission(self, request, obj=None):
1204+
return False
1205+
1206+
def has_module_permission(self, request):
1207+
return False
1208+
1209+
1210+
admin.site.register(Placeholder, PlaceholderAdmin)

0 commit comments

Comments
 (0)
0