Skip to content

Commit

Permalink
Replace context.setdefault() with if
Browse files Browse the repository at this point in the history
To keep Django 1.8 compatibility
  • Loading branch information
dmarcelino authored Feb 21, 2018
1 parent 969ceee commit ce4f786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sameas/templatetags/sameastags.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def __init__(self, name, nodelist, parent=None):

def render(self, context):
result = super(BlockNodeProxy, self).render(context)
context.setdefault(_block_key(self.name), self)
if _block_key(self.name) not in context:
context[_block_key(self.name)] = self
return result


Expand Down

0 comments on commit ce4f786

Please sign in to comment.