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 Mar 23, 2023
1 parent efbd5b9 commit 9fd88aa
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 @@ -203,6 +203,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."))
tmpdir = mkdtemp()
self._acquire_in_use()
try:
Expand Down

0 comments on commit 9fd88aa

Please sign in to comment.