cant compare against None with ==

This commit is contained in:
codl 2017-08-07 15:56:22 +02:00
parent 2c2ba8567e
commit eaa43c07a7
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
2 changed files with 2 additions and 2 deletions

View File

@ -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'

View File

@ -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