Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jsheffie committed Jan 5, 2024
1 parent dc51c40 commit 9745df7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rangefilter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9745df7

Please sign in to comment.