mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Backtracked on setting category choices (fixed failed migration)
This commit is contained in:
parent
34b784d1e4
commit
43fab8a8b3
@ -201,8 +201,7 @@ class ColorThemeSelectForm(forms.ModelForm):
|
|||||||
class SettingCategorySelectForm(forms.ModelForm):
|
class SettingCategorySelectForm(forms.ModelForm):
|
||||||
""" Form for setting category settings """
|
""" Form for setting category settings """
|
||||||
|
|
||||||
name = forms.ChoiceField(choices=[('', '-' * 10)] + PartCategory.get_parent_categories(),
|
name = forms.ChoiceField(required=False)
|
||||||
required=False)
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PartCategory
|
model = PartCategory
|
||||||
@ -213,6 +212,9 @@ class SettingCategorySelectForm(forms.ModelForm):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(SettingCategorySelectForm, self).__init__(*args, **kwargs)
|
super(SettingCategorySelectForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Populate category choices
|
||||||
|
self.fields['name'].choices = [('', '-' * 10)] + PartCategory.get_parent_categories()
|
||||||
|
|
||||||
self.helper = FormHelper()
|
self.helper = FormHelper()
|
||||||
# Form rendering
|
# Form rendering
|
||||||
self.helper.form_show_labels = False
|
self.helper.form_show_labels = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user