cant compare against None with ==
This commit is contained in:
parent
2c2ba8567e
commit
eaa43c07a7
2
model.py
2
model.py
|
@ -146,7 +146,7 @@ class TwitterArchive(db.Model, TimestampMixin):
|
||||||
chunks_failed = db.Column(db.Integer, server_default='0', nullable=False)
|
chunks_failed = db.Column(db.Integer, server_default='0', nullable=False)
|
||||||
|
|
||||||
def status(self):
|
def status(self):
|
||||||
if self.chunks == None or self.chunks_failed > 0:
|
if self.chunks is None or self.chunks_failed > 0:
|
||||||
return 'failed'
|
return 'failed'
|
||||||
if self.chunks_successful == self.chunks:
|
if self.chunks_successful == self.chunks:
|
||||||
return 'successful'
|
return 'successful'
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for archive in g.viewer.account.twitter_archives %}
|
{% for archive in g.viewer.account.twitter_archives %}
|
||||||
<li class="tweet_archive" data-status="{{archive.status()}}">{{archive.created_at.strftime('%Y-%m-%d %H:%M')}}<br>
|
<li class="tweet_archive" data-status="{{archive.status()}}">{{archive.created_at.strftime('%Y-%m-%d %H:%M')}}<br>
|
||||||
{% if archive.chunks == None %}
|
{% if archive.chunks is None %}
|
||||||
{{archive.chunks_successful}}/{{archive.chunks}} months imported, {{archive.chunks_failed}} failed</li>
|
{{archive.chunks_successful}}/{{archive.chunks}} months imported, {{archive.chunks_failed}} failed</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
Archive could not be opened
|
Archive could not be opened
|
||||||
|
|
Loading…
Reference in New Issue