Skip to content

Commit 2395d4a

Browse files
committed
fix 'custom_admin_template' for previous versions with warnings
1 parent 45fff3a commit 2395d4a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

streamfield/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ def admin_instance_class(model, base=DetailView):
1313
# will be removed in future. use above approach to override admin template.
1414
if hasattr(model, 'custom_admin_template'):
1515
tmpl_name = model.custom_admin_template
16+
import warnings
17+
warnings.warn(
18+
"'custom_admin_template' will be removed in future. "
19+
"Use override admin template approach instead",
20+
DeprecationWarning, stacklevel=2)
1621
else:
1722
tmpl_name = tmpl.template.name
1823

0 commit comments

Comments
 (0)