Skip to content

Commit ca79c61

Browse files
committed
Added a 'dumptime' entry to the JSON return from /api/version, in order to be able to make sure that running 'test-crawl --diff' will use database data from the same dump to avoid false page diff positives. Commit ready for merge.
- Legacy-Id: 18752
1 parent 5367895 commit ca79c61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ietf/api/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
import json
6+
import pytz
67

78
from jwcrypto.jwk import JWK
89

@@ -36,6 +37,7 @@
3637
from ietf.stats.models import MeetingRegistration
3738
from ietf.utils.decorators import require_api_key
3839
from ietf.utils.log import log
40+
from ietf.utils.models import DumpInfo
3941

4042

4143
def top_level(request):
@@ -202,10 +204,13 @@ def err(code, text):
202204

203205

204206
def version(request):
207+
dumpinfo = DumpInfo.objects.order_by('-date').first()
208+
dumptime = pytz.timezone(dumpinfo.tz).localize(dumpinfo.date).strftime('%Y-%m-%d %H:%M:%S %z') if dumpinfo else None
205209
return HttpResponse(
206-
json.dumps({
210+
json.dumps({
207211
'version': ietf.__version__+ietf.__patch__,
208212
'date': ietf.__date__[7:-2],
213+
'dumptime': dumptime,
209214
}),
210215
content_type='application/json',
211216
)

0 commit comments

Comments
 (0)