aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/report_ops/status.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/python/report_ops/status.py b/python/report_ops/status.py
index cb0c9309..f89afb99 100644
--- a/python/report_ops/status.py
+++ b/python/report_ops/status.py
@@ -74,12 +74,11 @@ class QuantifiRemote(
except UniqueViolation:
item._conn.rollback()
else:
- QuantifiMonitor.stage(data)
- buf.seek(0)
- QuantifiMonitor.email(
- fname.removesuffix(".xml"), int(data["errors"]) > 0, buf.getvalue()
- )
- QuantifiMonitor._staging_queue.clear()
+ if int(data["errors"]) > 0:
+ QuantifiMonitor.stage(data)
+ buf.seek(0)
+ QuantifiMonitor.email(fname.removesuffix(".xml"), True, buf.getvalue())
+ QuantifiMonitor._staging_queue.clear()
finally:
item._insert_queue.clear()