Skip to content

Commit 7c35da4

Browse files
committed
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
1 parent 5d22df9 commit 7c35da4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ietf/idrfc/views_search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,8 @@ def ad_dashboard_sort_key(doc):
656656
ageseconds = 0
657657
changetime= doc.latest_event(type='changed_document')
658658
if changetime:
659-
ageseconds = (datetime.datetime.now()-doc.latest_event(type='changed_document').time).total_seconds()
659+
ad = (datetime.datetime.now()-doc.latest_event(type='changed_document').time)
660+
ageseconds = (ad.microseconds + (ad.seconds + ad.days * 24 * 3600) * 10**6) / 10**6
660661
return "1%d%s%s%010d" % (state[0].order,seed,doc.type.slug,ageseconds)
661662

662663
return "3%s" % seed

0 commit comments

Comments
 (0)