Skip to content

Commit

Permalink
Make oSUMO admin page deal with old data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Sep 5, 2013
1 parent 17c101c commit c6ab607
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kitsune/offline/admin.py
Expand Up @@ -45,9 +45,13 @@ def offline_admin(request):

bundle['hash'] = redis.hget(key, 'hash')

updated = float(redis.hget(key, 'updated'))
updated = datetime.datetime.fromtimestamp(updated)
bundle['updated'] = updated.strftime('%Y-%m-%d %H:%M:%S')
updated = redis.hget(key, 'updated')
if updated is not None:
updated = float(redis.hget(key, 'updated'))

This comment has been minimized.

Copy link
@shuhaowu

shuhaowu Sep 6, 2013

Contributor

Ha! this line could really be simplified to float(updated)

Though, I would be in favour of reverting this commit now that we dealt with the problems on stage.

updated = datetime.datetime.fromtimestamp(updated)
bundle['updated'] = updated.strftime('%Y-%m-%d %H:%M:%S')
else:
bundle['updated'] = 'N/A'

bundle['size'] = round(len(redis.hget(key, 'bundle')) / 1024.0, 2)
totalsize += bundle['size']
Expand Down

0 comments on commit c6ab607

Please sign in to comment.