Skip to content

Commit c309ca9

Browse files
committed
fix(storage): actually, always set self.status (default None)
1 parent ccf8231 commit c309ca9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

api/utils/storage/BaseStorage.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self, path, status=None):
1111
self.status = status
1212

1313
def updateStatus(self, type, progress):
14-
if hasattr(self, "status"):
14+
if self.status:
1515
self.status.update(type, progress)
1616

1717
def extract(self):
@@ -74,12 +74,10 @@ def test(url):
7474

7575
def __init__(self, url, **kwargs):
7676
self.url = url
77-
status = kwargs.get("status", None)
78-
if status:
79-
self.status = status
77+
self.status = kwargs.get("status", None)
8078

8179
def updateStatus(self, type, progress):
82-
if hasattr(self, "status"):
80+
if self.status:
8381
self.status.update(type, progress)
8482

8583
def splitext(self):

0 commit comments

Comments
 (0)