2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

Fix calls to super()

This commit is contained in:
Oliver Walters 2022-05-06 23:32:09 +10:00
parent 12c58b14d6
commit 243e3ff37d
6 changed files with 11 additions and 11 deletions

View File

@ -131,7 +131,7 @@ def round_decimal(value, places):
class RoundingDecimalFormField(forms.DecimalField): class RoundingDecimalFormField(forms.DecimalField):
def to_python(self, value): def to_python(self, value):
value = super(RoundingDecimalFormField, self).to_python(value) value = super().to_python(value)
value = round_decimal(value, self.decimal_places) value = round_decimal(value, self.decimal_places)
return value return value
@ -149,7 +149,7 @@ class RoundingDecimalFormField(forms.DecimalField):
class RoundingDecimalField(models.DecimalField): class RoundingDecimalField(models.DecimalField):
def to_python(self, value): def to_python(self, value):
value = super(RoundingDecimalField, self).to_python(value) value = super().to_python(value)
return round_decimal(value, self.decimal_places) return round_decimal(value, self.decimal_places)
def formfield(self, **kwargs): def formfield(self, **kwargs):

View File

@ -58,7 +58,7 @@ class HelperForm(forms.ModelForm):
def is_valid(self): def is_valid(self):
valid = super(HelperForm, self).is_valid() valid = super().is_valid()
return valid return valid

View File

@ -51,7 +51,7 @@ class InvenTreeMoneySerializer(MoneyField):
Test that the returned amount is a valid Decimal Test that the returned amount is a valid Decimal
""" """
amount = super(DecimalField, self).get_value(data) amount = super().get_value(data)
# Convert an empty string to None # Convert an empty string to None
if len(str(amount).strip()) == 0: if len(str(amount).strip()) == 0:

View File

@ -687,7 +687,7 @@ class IndexView(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(TemplateView, self).get_context_data(**kwargs) context = super().get_context_data(**kwargs)
return context return context
@ -882,7 +882,7 @@ class SettingCategorySelectView(FormView):
def get_initial(self): def get_initial(self):
""" Set category selection """ """ Set category selection """
initial = super(SettingCategorySelectView, self).get_initial() initial = super().get_initial()
category = self.request.GET.get('category', None) category = self.request.GET.get('category', None)
if category: if category:

View File

@ -29,7 +29,7 @@ class BuildIndex(InvenTreeRoleMixin, ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(BuildIndex, self).get_context_data(**kwargs).copy() context = super(self).get_context_data(**kwargs).copy()
context['BuildStatus'] = BuildStatus context['BuildStatus'] = BuildStatus
@ -52,7 +52,7 @@ class BuildDetail(InvenTreeRoleMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super(DetailView, self).get_context_data(**kwargs) ctx = super().get_context_data(**kwargs)
build = self.get_object() build = self.get_object()

View File

@ -979,7 +979,7 @@ class CategoryDetail(InvenTreeRoleMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(CategoryDetail, self).get_context_data(**kwargs).copy() context = super().get_context_data(**kwargs).copy()
try: try:
context['part_count'] = kwargs['object'].partcount() context['part_count'] = kwargs['object'].partcount()
@ -1045,7 +1045,7 @@ class CategoryParameterTemplateCreate(AjaxCreateView):
- Display parameter templates which are not yet related - Display parameter templates which are not yet related
""" """
form = super(AjaxCreateView, self).get_form() form = super().get_form()
form.fields['category'].widget = HiddenInput() form.fields['category'].widget = HiddenInput()
@ -1140,7 +1140,7 @@ class CategoryParameterTemplateEdit(AjaxUpdateView):
- Display parameter templates which are not yet related - Display parameter templates which are not yet related
""" """
form = super(AjaxUpdateView, self).get_form() form = super().get_form()
form.fields['category'].widget = HiddenInput() form.fields['category'].widget = HiddenInput()
form.fields['add_to_all_categories'].widget = HiddenInput() form.fields['add_to_all_categories'].widget = HiddenInput()