-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathadmin.py
More file actions
30 lines (21 loc) · 1.04 KB
/
admin.py
File metadata and controls
30 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
from django.contrib import admin
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from feincms import settings
from .modeladmins import PageAdmin
from .models import Page
# ------------------------------------------------------------------------
if settings.FEINCMS_USE_PAGE_ADMIN:
try:
Page._meta.get_field("template_key")
except FieldDoesNotExist:
raise ImproperlyConfigured(
"The page module requires a 'Page.register_templates()' call "
"somewhere ('Page.register_regions()' is not sufficient). "
"If you're not using the default Page admin, maybe try "
"FEINCMS_USE_PAGE_ADMIN=False to avoid this warning."
)
admin.site.register(Page, PageAdmin)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------