Skip to content

Commit

Permalink
Merge branch 'victor-o-silva-fix-for-django-2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bashu committed May 9, 2018
2 parents dd422af + d31d375 commit 1f0f67b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -11,6 +11,7 @@ env:
- DJANGO="Django>=1.9,<1.10"
- DJANGO="Django>=1.10,<1.11"
- DJANGO="Django>=1.11,<1.12"
- DJANGO="Django>=2.0,<2.1"
- DJANGO="https://github.com/django/django/archive/master.tar.gz"
before_install:
- pip install -q $DJANGO
Expand All @@ -22,6 +23,8 @@ matrix:
exclude:
- python: "3.4"
env: DJANGO="Django>=1.4,<1.5"
- python: "2.7"
env: DJANGO="Django>=2.0,<2.1"
- python: "2.7"
env: DJANGO="https://github.com/django/django/archive/master.tar.gz"
allow_failures:
Expand Down
9 changes: 7 additions & 2 deletions spurl/templatetags/spurl.py
Expand Up @@ -5,7 +5,12 @@
from django.utils.html import escape
from django.utils.encoding import smart_str
from django.template.base import Lexer, Parser
from django.template import StringOrigin

try:
from django.template import StringOrigin as Origin
except ImportError:
from django.template import Origin

from django.template.defaulttags import kwarg_re
from django.template import Template, Library, Node, TemplateSyntaxError

Expand Down Expand Up @@ -226,7 +231,7 @@ def render_template(self, template_string):
settings, 'TEMPLATE_DEBUG', template.engine.debug if hasattr(
template, 'engine') else False)
if template_debug is True:
origin = StringOrigin(template_string)
origin = Origin(template_string)
else:
origin = None

Expand Down

0 comments on commit 1f0f67b

Please sign in to comment.