TemplateMixin should copy initial context to prevent accidental context sharing
This commit is contained in:
parent
8a9b74e1d3
commit
83869739e6
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import codecs
|
import codecs
|
||||||
|
import copy
|
||||||
|
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ class TemplateMixin(object):
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
def get_context(self):
|
def get_context(self):
|
||||||
return self.context
|
return copy.copy(self.context)
|
||||||
|
|
||||||
def render(self, output_directory, jinja_env):
|
def render(self, output_directory, jinja_env):
|
||||||
context = self.get_context()
|
context = self.get_context()
|
||||||
|
|
Loading…
Reference in New Issue