Commit 9c487b59 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Replaced an antiquated pattern.

Thanks Lennart Regebro for pointing it out.
parent b1bfd963
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ from django.utils.encoding import force_text

HORIZONTAL, VERTICAL = 1, 2
# returns the <ul> class for a given radio_admin field
get_ul_class = lambda x: 'radiolist%s' % ((x == HORIZONTAL) and ' inline' or '')
get_ul_class = lambda x: 'radiolist%s' % (' inline' if x == HORIZONTAL else '')


class IncorrectLookupParameters(Exception):
@@ -189,7 +189,7 @@ class BaseModelAdmin(six.with_metaclass(RenameBaseModelAdminMethods)):
            kwargs['widget'] = widgets.AdminRadioSelect(attrs={
                'class': get_ul_class(self.radio_fields[db_field.name]),
            })
            kwargs['empty_label'] = db_field.blank and _('None') or None
            kwargs['empty_label'] = _('None') if db_field.blank else None

        queryset = self.get_field_queryset(db, db_field, request)
        if queryset is not None:
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ def next_redirect(request, fallback, **get_kwargs):
        else:
            anchor = ''

        joiner = ('?' in next) and '&' or '?'
        joiner = '&' if '?' in next else '?'
        next += joiner + urlencode(get_kwargs) + anchor
    return HttpResponseRedirect(next)

+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ def shortcut(request, content_type_id, object_id):
    # If all that malarkey found an object domain, use it. Otherwise, fall back
    # to whatever get_absolute_url() returned.
    if object_domain is not None:
        protocol = request.is_secure() and 'https' or 'http'
        protocol = 'https' if request.is_secure() else 'http'
        return http.HttpResponseRedirect('%s://%s%s'
                                         % (protocol, object_domain, absurl))
    else:
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ from django.contrib.formtools.wizard.views import (WizardView,
class DummyRequest(http.HttpRequest):
    def __init__(self, POST=None):
        super(DummyRequest, self).__init__()
        self.method = POST and "POST" or "GET"
        self.method = "POST" if POST else "GET"
        if POST is not None:
            self.POST.update(POST)
        self.session = {}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ def index(request, sitemaps):
    """
    current_site = get_current_site(request)
    sites = []
    protocol = request.is_secure() and 'https' or 'http'
    protocol = 'https' if request.is_secure() else 'http'
    for section, site in sitemaps.items():
        if callable(site):
            pages = site().paginator.num_pages
Loading