Commit e5122814 authored by 李小芳's avatar 李小芳

grey

parent a6e13b01
......@@ -1096,7 +1096,7 @@ class Answer(models.Model):
delta_30 = datetime.timedelta(days=30)
delta_90 = datetime.timedelta(days=90)
delta_365 = datetime.timedelta(days=365)
if d2:
if d2 and create_time and (delta_30 or delta_90 or delta_365):
if d2 - delta_30 <= create_time:
return 30
elif d2 - delta_90 <= create_time:
......
......@@ -205,12 +205,15 @@ class Tractate(models.Model):
delta_30 = datetime.timedelta(days=30)
delta_90 = datetime.timedelta(days=90)
delta_365 = datetime.timedelta(days=365)
if d2 - delta_30 <= create_time:
return 30
elif d2 - delta_90 <= create_time:
return 90
elif d2 - delta_365 <= create_time:
return 365
if d2 and create_time and (delta_30 or delta_90 or delta_365):
if d2 - delta_30 <= create_time:
return 30
elif d2 - delta_90 <= create_time:
return 90
elif d2 - delta_365 <= create_time:
return 365
else:
return 1000
else:
return 1000
except:
......
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