Error status wasn't correctly transmitted to UI after recent changes.

Mon, 05 Feb 2018 18:32:36 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 05 Feb 2018 18:32:36 +0000
changeset 108
6409aa77ddd5
parent 107
f63835e9f29e
child 109
246190bfd501

Error status wasn't correctly transmitted to UI after recent changes.

borgend/backup.py file | annotate | diff | comparison | revisions
--- a/borgend/backup.py	Mon Feb 05 18:24:30 2018 +0000
+++ b/borgend/backup.py	Mon Feb 05 18:32:36 2018 +0000
@@ -99,24 +99,23 @@
 
 class Status(Operation):
     def __init__(self, backup, op=None):
-        op=None
-        errorsop=None
+        op=backup.current_operation
+        errorsop=backup.previous_operation
 
-        if backup.current_operation:
-            op=backup.current_operation
-        elif backup.scheduled_operation:
+        if not op:
             op=backup.scheduled_operation
-            if backup.previous_operation:
-                errorsop=backup.previous_operation
 
         if op:
             super().__init__(op.type, op.start_time, **op.detail)
-            if not errorsop:
-                errorsop=op
-            self.errors=errorsop.errors
         else:
             super().__init__(None, None)
 
+        if not errorsop:
+            errorsop=op
+
+        if errorsop:
+            self.errors=errorsop.errors
+
         self.name=backup.name
         self.state=backup.state
 

mercurial