Made the cookie handling for the 'new_enough' cookie insensitive to nonnumeric values.
- Legacy-Id: 9009
This commit is contained in:
parent
6ec0e9ba6a
commit
05a617d3b2
|
@ -399,10 +399,11 @@ def unescape(text):
|
|||
|
||||
@register.filter(name='new_enough')
|
||||
def new_enough(x,request):
|
||||
days = 14
|
||||
if "new_enough" in request.COOKIES:
|
||||
days = int(request.COOKIES["new_enough"])
|
||||
else:
|
||||
days = 14
|
||||
value = request.COOKIES["new_enough"]
|
||||
if value.isdigit():
|
||||
days = int(value)
|
||||
return x < days
|
||||
|
||||
@register.filter(name='expires_soon')
|
||||
|
|
Loading…
Reference in a new issue