Loading django/contrib/admin/options.py +1 −2 Original line number Diff line number Diff line Loading @@ -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 = [] Loading django/contrib/admin/views/main.py +1 −26 Original line number Diff line number Diff line from collections import OrderedDict import sys import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage Loading @@ -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 Loading @@ -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, Loading @@ -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: Loading Loading
django/contrib/admin/options.py +1 −2 Original line number Diff line number Diff line Loading @@ -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 = [] Loading
django/contrib/admin/views/main.py +1 −26 Original line number Diff line number Diff line from collections import OrderedDict import sys import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage Loading @@ -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 Loading @@ -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, Loading @@ -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: Loading