Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Commit

Permalink
Fix negative time error in Update news
Browse files Browse the repository at this point in the history
  • Loading branch information
takidog committed Oct 11, 2019
1 parent efc6609 commit 81c8d77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/news/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def update_news(news_id=None, **kwargs):
if kwargs.get('expireTime', origin_news.get('expireTime', False)):
utc = time_format(kwargs.get(
'expireTime', origin_news.get('expireTime', False)))
expire_time_seconds = (utc-datetime.datetime.utcnow()).seconds
expire_time_seconds = (utc-datetime.datetime.utcnow()).total_seconds()
data_dumps = json.dumps(news_data, ensure_ascii=False)

red_news.set(name=news_name,
Expand Down

0 comments on commit 81c8d77

Please sign in to comment.