﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18615	Allow retrieval of the signature age using the signing API	Bruno Renié	nobody	"Currently there is no way to retrieve the time a value was dumped when unsigning it. One way to do hack around this limitation is to do:

{{{#!python
import datetime

from django.core import signing
from django.utils import timezone


def loads_with_timestamp(value, salt):
    try:
        data = signing.loads(value, salt=salt, max_age=-1)
    except signing.SignatureExpired as e:
        age = float(str(e).split('Signature age ')[1].split(' >')[0])
        timestamp = timezone.now() - datetime.timedelta(seconds=age)
    return timestamp, signing.loads(value, salt=salt)
}}}

This isn't particularly elegant. It'd be great if the API allowed that kind of thing, although I'm not sure what's the best way to do it:

* a flag that changes the return value of the `loads` function? (ugh)
* a new function, `loads_with_timestamp`? (name bikeshedding ensues)
* an API change in Django 1.7 and opt-in in previous versions?

Maybe there are other ways…"	New feature	new	Core (Other)	dev	Normal				Accepted	0	0	0	0	0	0
