Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEMPLATE_MINIFER_STRIP_FUNCTION - do not accept string #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion template_minifying_loader/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re

from django.conf import settings
from django.utils.module_loading import import_string


def strip_spaces_in_template(template_source):
Expand Down Expand Up @@ -30,6 +31,7 @@ def get_template_minifier_strip_function():
TEMPLATE_MINIFIER_STRIP_FUNCTION setting.
"""
if getattr(settings, 'TEMPLATE_MINIFIER_STRIP_FUNCTION', False):
return settings.TEMPLATE_MINIFIER_STRIP_FUNCTION
fce = import_string(settings.TEMPLATE_MINIFIER_STRIP_FUNCTION)
return fce
else:
return strip_spaces_in_template