Skip to content

Commit

Permalink
Fixed an issue in search and replace
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Sep 26, 2024
1 parent 9028631 commit 03bf94f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Changelog

- Python 3, Plone 5.2 and Plone 6.0 compatible.
[aduchene]

- Fixed an issue when odt_file.filename could be None when searching and replacing.
[aduchene]

3.43 (2024-04-10)
-----------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'z3c.table',
# fix about orderedselect
'z3c.form>=3.2.4',
'imio.helpers>=0.57',
'imio.helpers>=1.0',
'imio.migrator>=1.11'
],
extras_require={
Expand Down
8 changes: 8 additions & 0 deletions src/collective/documentgenerator/tests/test_search_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,11 @@ def test_search_replace_control_panel_regex_validator(self):
data = {"replacements": replacements}
errors = form.widgets.validate(data)
self.assertFalse(errors)

def test_no_odt_file_or_no_filename(self):
self.template1.odt_file = None
self.template2.odt_file.filename = None
with SearchAndReplacePODTemplates((self.template1, self.template2)) as search_replace:
results = search_replace.search("view")

self.assertEqual(len(results.keys()), 0)

0 comments on commit 03bf94f

Please sign in to comment.