diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-14 14:36:11 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-14 14:45:28 +0200 |
| commit | c2d59e556499ecee3d8a1fc684f49a21463ab1c1 (patch) | |
| tree | 67741a9025a85cdd58a705e299019bad176ba4a5 /django | |
| parent | d6b8b125fbd370bb575c43ba66270e22de919a51 (diff) | |
[py3] Fixed admin_views tests
Also changed several occurrences of 'request' to 'response'.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/templatetags/log.py | 2 | ||||
| -rw-r--r-- | django/contrib/admin/views/main.py | 2 | ||||
| -rw-r--r-- | django/db/models/base.py | 2 | ||||
| -rw-r--r-- | django/utils/cache.py | 2 | ||||
| -rw-r--r-- | django/utils/text.py | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/django/contrib/admin/templatetags/log.py b/django/contrib/admin/templatetags/log.py index 888b5ed9c3..463e0792f0 100644 --- a/django/contrib/admin/templatetags/log.py +++ b/django/contrib/admin/templatetags/log.py @@ -17,7 +17,7 @@ class AdminLogNode(template.Node): user_id = self.user if not user_id.isdigit(): user_id = context[self.user].id - context[self.varname] = LogEntry.objects.filter(user__id__exact=user_id).select_related('content_type', 'user')[:self.limit] + context[self.varname] = LogEntry.objects.filter(user__id__exact=user_id).select_related('content_type', 'user')[:int(self.limit)] return '' @register.tag diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 3eabf3dbeb..4ff1a9cce5 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -148,7 +148,7 @@ class ChangeList(object): if remove is None: remove = [] p = self.params.copy() for r in remove: - for k in p.keys(): + for k in list(p.keys()): if k.startswith(r): del p[k] for k, v in new_params.items(): diff --git a/django/db/models/base.py b/django/db/models/base.py index 157b74ae49..1beb6f9e30 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -855,7 +855,7 @@ class Model(six.with_metaclass(ModelBase, object)): } # unique_together else: - field_labels = map(lambda f: capfirst(opts.get_field(f).verbose_name), unique_check) + field_labels = [capfirst(opts.get_field(f).verbose_name) for f in unique_check] field_labels = get_text_list(field_labels, _('and')) return _("%(model_name)s with this %(field_label)s already exists.") % { 'model_name': six.text_type(model_name), diff --git a/django/utils/cache.py b/django/utils/cache.py index edac6ec75d..3e99833aa6 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -66,7 +66,7 @@ def patch_cache_control(response, **kwargs): # max-age, use the minimum of the two ages. In practice this happens when # a decorator and a piece of middleware both operate on a given view. if 'max-age' in cc and 'max_age' in kwargs: - kwargs['max_age'] = min(cc['max-age'], kwargs['max_age']) + kwargs['max_age'] = min(int(cc['max-age']), kwargs['max_age']) # Allow overriding private caching and vice versa if 'private' in cc and 'public' in kwargs: diff --git a/django/utils/text.py b/django/utils/text.py index 0838d79c65..d7f3a03174 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -287,7 +287,7 @@ ustring_re = re.compile("([\u0080-\uffff])") def javascript_quote(s, quote_double_quotes=False): def fix(match): - return b"\u%04x" % ord(match.group(1)) + return "\\u%04x" % ord(match.group(1)) if type(s) == bytes: s = s.decode('utf-8') |
