Skip to content
Snippets Groups Projects
Commit bd6c9d30 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'fix/515' into 'master'

this changes prevents trying to replace placeholders not used in the file....

See merge request !431
parents 6f80a3cd 24f5668f
No related branches found
No related tags found
1 merge request!431this changes prevents trying to replace placeholders not used in the file....
Pipeline #70474 passed
smasch (1.3.0-1) stable; urgency=medium
* bug fix: avoid replacing unused placeholders in template (#515)
-- Carlos Vega <carlos.vega@uni.lu> Fri, 24 Mar 2023 12:00:00 +0200
smasch (1.2.1-1) unstable; urgency=medium
* bug fix: subject_type was not properly retrieved from the given ID in
......
......@@ -22,7 +22,8 @@ def process_file(path_to_docx, path_to_new_docx, changes_to_apply):
for row in table.rows:
for cell in row.cells:
for paragraph in cell.paragraphs:
paragraph.text = paragraph.text.replace(placeholder, replacement)
if placeholder in paragraph.text:
paragraph.text = paragraph.text.replace(placeholder, replacement)
doc.save(path_to_new_docx)
......
......@@ -258,7 +258,7 @@ desired effect
{% block footer %}
<!-- To the right -->
<div class="pull-right hidden-xs">
Version: <strong>1.2.1</strong>
Version: <strong>1.3.0</strong>
</div>
<!-- Default to the left -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment