From 9745df75d4981bd6d167135bdc7bb12a454efa5a Mon Sep 17 00:00:00 2001 From: Jeff Sheffield Date: Fri, 5 Jan 2024 10:18:45 -0600 Subject: [PATCH] linting --- rangefilter/filters.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rangefilter/filters.py b/rangefilter/filters.py index 8eccb3c..f67cc6b 100644 --- a/rangefilter/filters.py +++ b/rangefilter/filters.py @@ -14,7 +14,6 @@ from django import forms from django.conf import settings from django.contrib import admin -from django.contrib.admin.widgets import AdminDateWidget from django.template.defaultfilters import slugify from django.templatetags.static import StaticNode from django.utils import timezone @@ -27,9 +26,9 @@ from django.utils.translation import ugettext_lazy as _ # pylint: disable=E0611 if django.VERSION >= (4, 2, 0): + from django.contrib.admin.widgets import AdminDateWidget from django.contrib.admin.widgets import BaseAdminDateWidget, BaseAdminTimeWidget else: - # from django.contrib.admin.widgets import AdminSplitDateTime as BaseAdminSplitDateTime from django.contrib.admin.widgets import AdminDateWidget as BaseAdminDateWidget from django.contrib.admin.widgets import AdminTimeWidget as BaseAdminTimeWidget @@ -72,14 +71,14 @@ def __init__( attrs=None, date_attrs=None, time_attrs=None, - ): + ): # pylint: disable=W0231 widgets = ( BaseAdminDateWidget(attrs=attrs if date_attrs is None else date_attrs), BaseAdminTimeWidget(attrs=attrs if time_attrs is None else time_attrs), ) # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets, so not pass in the attr's they are already setup. - forms.MultiWidget.__init__(self, widgets) + forms.MultiWidget.__init__(self, widgets) # pylint: disable=W0233 def get_context(self, name, value, attrs): context = super().get_context(name, value, attrs)