Skip to content

Commit

Permalink
[FIX] *_auditfile_export: handle corner case for single threaded servers
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed May 8, 2023
1 parent 8fb8ae7 commit 46e9438
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions l10n_nl_xaf_auditfile_export/models/xaf_auditfile_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ def _get_auditfile_template(self):

def button_generate(self):
"""Generate, store and validate auditfile."""
# First check wether file is already there. Should not be possible, because of
# the locking, but there is a corner case for single threaded servers, where
# this button can be pressed after another sessions has already started the
# generation. Then this method will only run after the first job released the
# lock and finished processing.
if self.auditfile:
raise exceptions.UserError(_("Auditfile has already been generated."))

Check warning on line 217 in l10n_nl_xaf_auditfile_export/models/xaf_auditfile_export.py

View check run for this annotation

Codecov / codecov/patch

l10n_nl_xaf_auditfile_export/models/xaf_auditfile_export.py#L217

Added line #L217 was not covered by tests
tmpdir = mkdtemp()
self._acquire_in_use()
try:
Expand Down

0 comments on commit 46e9438

Please sign in to comment.