Skip to content

Commit 5b6ffbc

Browse files
committed
Fixed a bug in the API cache key construction which could make the key longer than necessary.
- Legacy-Id: 12196
1 parent 8e2259e commit 5b6ffbc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/api/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from django.core.urlresolvers import reverse
1010
from django.utils.encoding import force_text
1111

12+
import debug # pyflakes:ignore
13+
1214
import tastypie
1315
import tastypie.resources
1416
from tastypie.api import Api
@@ -34,7 +36,7 @@ def generate_cache_key(self, *args, **kwargs):
3436
smooshed = urlencode(kwargs)
3537

3638
# Use a list plus a ``.join()`` because it's faster than concatenation.
37-
return "%s:%s:%s:%s" % (self._meta.api_name, self._meta.resource_name, ':'.join(args), ':'.join(sorted(smooshed)))
39+
return "%s:%s:%s:%s" % (self._meta.api_name, self._meta.resource_name, ':'.join(args), smooshed)
3840

3941
class Serializer(BaseSerializer):
4042
def to_html(self, data, options=None):

0 commit comments

Comments
 (0)