File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 15
15
def override_tag (
16
16
register : django .template .Library ,
17
17
name : str ,
18
- default_html : typing .Optional [typing .Any ] = UNSPECIFIED ,
18
+ default_html : typing .Optional [typing .Any ] = None ,
19
19
):
20
20
"""
21
21
An utility that helps you override original tags for use in your pattern library.
@@ -95,14 +95,15 @@ def node_render(context):
95
95
Warning ,
96
96
)
97
97
else :
98
- raise TypeError (
98
+ warnings . warn (
99
99
'default_html argument to override_tag must be a string (line %s in "%s")'
100
100
% (trace .lineno , trace .filename )
101
101
)
102
+ default_html = None
102
103
103
104
# Render provided default;
104
105
# if no stub data supplied.
105
- return default_html
106
+ return default_html or ""
106
107
else :
107
108
logger .warning (
108
109
'No default or stub data defined for the "%s" tag in the "%s" template' ,
You can’t perform that action at this time.
0 commit comments