Commit a56f28a1 authored by kai's avatar kai

update

parent 1ca591ea
...@@ -321,18 +321,17 @@ class Topic(models.Model): ...@@ -321,18 +321,17 @@ class Topic(models.Model):
datetime_list = list() datetime_list = list()
if reply_query_results.count() > 0: if reply_query_results.count() > 0:
for reply in reply_query_results: for reply in reply_query_results:
UserExtra_results = UserExtra.objects.using(settings.SLAVE_DB_NAME).filter( UserExtra_results = UserExtra.objects.using(settings.SLAVE_DB_NAME).filter(user_id=reply['user_id']).values('is_shadow')
user_id=reply['user_id']).values('is_shadow') if UserExtra_results.count()>0:
if UserExtra_results.count() > 0:
if not UserExtra_results[0]['is_shadow']: if not UserExtra_results[0]['is_shadow']:
datetime_list.append(reply['create_time']) datetime_list.append(reply['create_time'])
dt = max(datetime_list) dt = max(datetime_list)
return datetime.datetime(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, return datetime.datetime(dt.year,dt.month,dt.day,dt.hour, dt.minute, dt.second,tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
else: else:
return datetime.datetime(1980, 1, 1, 0, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=8))) 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)))
except: except:
return datetime.datetime(1980, 1, 1, 0, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=8))) return datetime.datetime(1980,1,1,0,0,0,tzinfo=datetime.timezone(datetime.timedelta(hours=8)))
class TopicComplaint(models.Model): class TopicComplaint(models.Model):
......
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