Commit 12e1cf10 authored by 黄凯's avatar 黄凯

Merge branch 'revise_reply_time' into 'master'

revise reply time

See merge request alpha/physical!402
parents a04de3f5 5fa03096
......@@ -325,8 +325,13 @@ class Topic(models.Model):
if UserExtra_results.count()>0:
if not UserExtra_results[0]['is_shadow']:
datetime_list.append(reply['create_time'])
dt = max(datetime_list)
return datetime.datetime(dt.year,dt.month,dt.day,dt.hour, dt.minute, dt.second,tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
if len(datetime_list)>0:
dt = max(datetime_list)
return datetime.datetime(dt.year,dt.month,dt.day,dt.hour, dt.minute, dt.second,tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
else:
dt = self.create_time
return datetime.datetime(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second,
tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
else:
dt = self.create_time
return datetime.datetime(dt.year,dt.month,dt.day,dt.hour, dt.minute, dt.second,tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment