Applied a patch from rjsparks@nostrum.com:
This fixes an issue with /doc/ad2 that is python library version related: ageseconds = (datetime.datetime.now()-doc.latest_event(type=3D'changed_document').time).total_seconds() AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds' The production system is using 2.6, and that was a 2.7 feature. - Legacy-Id: 5665
This commit is contained in:
parent
5d22df9e25
commit
7c35da472a
|
@ -656,7 +656,8 @@ def ad_dashboard_sort_key(doc):
|
|||
ageseconds = 0
|
||||
changetime= doc.latest_event(type='changed_document')
|
||||
if changetime:
|
||||
ageseconds = (datetime.datetime.now()-doc.latest_event(type='changed_document').time).total_seconds()
|
||||
ad = (datetime.datetime.now()-doc.latest_event(type='changed_document').time)
|
||||
ageseconds = (ad.microseconds + (ad.seconds + ad.days * 24 * 3600) * 10**6) / 10**6
|
||||
return "1%d%s%s%010d" % (state[0].order,seed,doc.type.slug,ageseconds)
|
||||
|
||||
return "3%s" % seed
|
||||
|
|
Loading…
Reference in a new issue