summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 89bee27cd..bba04488b 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -196,7 +196,7 @@ class ValueGetter(object):
val = ''
elif (key in self.GET_VALUES_EXTRA_TYPES or "type" in key) and (
val.__class__.__name__.split('.')[0] == 'ManyRelatedManager'):
- val = u" ; ".join([str(v) for v in val.all()])
+ val = " ; ".join([str(v) for v in val.all()])
elif isinstance(val, (tuple, list, dict)):
pass
else:
@@ -214,13 +214,6 @@ class ValueGetter(object):
value_list.append((key, str(values[key])))
for global_var in GlobalVar.objects.all():
values[global_var.slug] = global_var.value or ""
- if not filtr or 'VALUES' in filtr:
- values['VALUES'] = json.dumps(
- values, indent=4, sort_keys=True,
- skipkeys=True, ensure_ascii=False,
- separators=("", " : "),
- ).replace(" " * 4, "\t")
-
return values
@classmethod
@@ -1459,7 +1452,14 @@ class DocumentTemplate(models.Model):
]
)
"""
+ filtr = []
values = c_object.get_values()
+ if not filtr or 'VALUES' in filtr:
+ values['VALUES'] = json.dumps(
+ values, indent=4, sort_keys=True,
+ skipkeys=True, ensure_ascii=False,
+ separators=("", " : "),
+ ).replace(" " * 4, "\t")
engine = IshtarSecretaryRenderer()
try:
result = engine.render(self.template, **values)