From ac02bb0b5b3abbde7dc0386ad687378eb36eb30a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 May 2021 23:23:09 +0300 Subject: Fix widgets for Django 3 --- servo/forms/base.py | 3 +-- servo/forms/orders.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'servo') diff --git a/servo/forms/base.py b/servo/forms/base.py index 64c672f..b59215b 100644 --- a/servo/forms/base.py +++ b/servo/forms/base.py @@ -73,7 +73,6 @@ class BaseModelForm(forms.ModelForm): class SearchFieldInput(forms.TextInput): def render(self, name, value, attrs=None): - field = super(SearchFieldInput, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs) @@ -94,7 +93,7 @@ class DatepickerInput(forms.DateInput): kwargs['format'] = "%Y-%m-%d" super(DatepickerInput, self).__init__(*args, **kwargs) - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): date_format = "yyyy-MM-dd" diff --git a/servo/forms/orders.py b/servo/forms/orders.py index 7b27d0b..ed58754 100644 --- a/servo/forms/orders.py +++ b/servo/forms/orders.py @@ -152,6 +152,8 @@ class OrderSearchForm(forms.Form): label=_('Status older than (days)'), ) + def __init__(self, request, *args, **kwargs): super(OrderSearchForm, self).__init__(*args, **kwargs) self.fields['location'].queryset = request.user.locations.all() + -- cgit v1.2.3