From 274048351ae2fc35995645a6dad7c98f74f51eb1 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 21 Mar 2014 11:35:33 -0400 Subject: [PATCH] Removed reading of legacy admin popup GET parameter. refs #20288. --- django/contrib/admin/options.py | 3 +-- django/contrib/admin/views/main.py | 27 +-------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 1050a0d591..b9049001e0 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -784,8 +784,7 @@ class ModelAdmin(BaseModelAdmin): """ # If self.actions is explicitly set to None that means that we don't # want *any* actions enabled on this page. - from django.contrib.admin.views.main import _is_changelist_popup - if self.actions is None or _is_changelist_popup(request): + if self.actions is None or IS_POPUP_VAR in request.GET: return OrderedDict() actions = [] diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 4433a7ec2a..d1b6d82a3e 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -1,6 +1,5 @@ from collections import OrderedDict import sys -import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage @@ -8,7 +7,6 @@ from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils import six -from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_text from django.utils.translation import ugettext, ugettext_lazy from django.utils.http import urlencode @@ -34,29 +32,6 @@ IGNORED_PARAMS = ( EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)') -def _is_changelist_popup(request): - """ - Returns True if the popup GET parameter is set. - - This function is introduced to facilitate deprecating the legacy - value for IS_POPUP_VAR and should be removed at the end of the - deprecation cycle. - """ - - if IS_POPUP_VAR in request.GET: - return True - - IS_LEGACY_POPUP_VAR = 'pop' - if IS_LEGACY_POPUP_VAR in request.GET: - warnings.warn( - "The `%s` GET parameter has been renamed to `%s`." % - (IS_LEGACY_POPUP_VAR, IS_POPUP_VAR), - RemovedInDjango18Warning, 2) - return True - - return False - - class ChangeList(object): def __init__(self, request, model, list_display, list_display_links, list_filter, date_hierarchy, search_fields, list_select_related, @@ -82,7 +57,7 @@ class ChangeList(object): except ValueError: self.page_num = 0 self.show_all = ALL_VAR in request.GET - self.is_popup = _is_changelist_popup(request) + self.is_popup = IS_POPUP_VAR in request.GET self.to_field = request.GET.get(TO_FIELD_VAR) self.params = dict(request.GET.items()) if PAGE_VAR in self.params: