diff --git a/model.py b/model.py index 06377e0..3277825 100644 --- a/model.py +++ b/model.py @@ -144,3 +144,10 @@ class TwitterArchive(db.Model, TimestampMixin): chunks = db.Column(db.Integer) chunks_successful = db.Column(db.Integer, server_default='0', nullable=False) chunks_failed = db.Column(db.Integer, server_default='0', nullable=False) + + def status(): + if self.chunks == None or self.chunks_failed > 0: + return 'failed' + if self.chunks_successful == self.chunks: + return 'successful' + return 'pending' diff --git a/templates/logged_in.html b/templates/logged_in.html index e283dca..123d5bf 100644 --- a/templates/logged_in.html +++ b/templates/logged_in.html @@ -81,8 +81,12 @@

Recent archives

{% endif %}