Skip to content

Commit 7624451

Browse files
authored
Merge branch 'main' into modified
2 parents d2e1c8d + d6d7372 commit 7624451

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

website/templatetags/custom_filters.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# avoid using custom filters if possible
12
import json
23

34
from django import template
@@ -17,6 +18,7 @@ def get_item(dictionary, key):
1718
def before_dot(value):
1819
return str(value).split(".")[0]
1920

21+
2022
@register.filter(name="to_json", is_safe=True)
2123
def to_json(value):
2224
"""Convert Python object to JSON string"""

0 commit comments

Comments
 (0)