equal
deleted
inserted
replaced
6 from random import randint |
6 from random import randint |
7 |
7 |
8 #django |
8 #django |
9 from django.http import HttpResponseRedirect |
9 from django.http import HttpResponseRedirect |
10 |
10 |
11 def kiwipycon_quote(string, encoding="utf-8"): |
11 def scipycon_quote(string, encoding="utf-8"): |
12 """Encodes string to encoding before quoting. |
12 """Encodes string to encoding before quoting. |
13 """ |
13 """ |
14 return urllib.quote(string.encode(encoding)) |
14 return urllib.quote(string.encode(encoding)) |
15 |
15 |
16 # from LFS |
16 # from LFS |
24 expires = datetime.datetime.strftime( |
24 expires = datetime.datetime.strftime( |
25 datetime.datetime.utcnow() + |
25 datetime.datetime.utcnow() + |
26 datetime.timedelta(seconds=max_age), "%a, %d-%b-%Y %H:%M:%S GMT") |
26 datetime.timedelta(seconds=max_age), "%a, %d-%b-%Y %H:%M:%S GMT") |
27 |
27 |
28 response = HttpResponseRedirect(url) |
28 response = HttpResponseRedirect(url) |
29 response.set_cookie("message", kiwipycon_quote(msg), max_age=max_age, expires=expires) |
29 response.set_cookie("message", scipycon_quote(msg), max_age=max_age, expires=expires) |
30 |
30 |
31 return response |
31 return response |
32 |
32 |
33 # from django-snippets |
33 # from django-snippets |
34 def slugify(inStr): |
34 def slugify(inStr): |