mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP cleanup
This commit is contained in:
parent
c63a061cf3
commit
35d64b7069
@ -177,39 +177,6 @@ class SetPasswordForm(HelperForm):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class ColorThemeSelectForm(forms.ModelForm):
|
|
||||||
""" Form for setting color theme """
|
|
||||||
|
|
||||||
name = forms.ChoiceField(choices=(), required=False)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = ColorTheme
|
|
||||||
fields = [
|
|
||||||
'name'
|
|
||||||
]
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
super(ColorThemeSelectForm, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
# Populate color themes choices
|
|
||||||
self.fields['name'].choices = ColorTheme.get_color_themes_choices()
|
|
||||||
|
|
||||||
self.helper = FormHelper()
|
|
||||||
# Form rendering
|
|
||||||
self.helper.form_show_labels = False
|
|
||||||
self.helper.layout = Layout(
|
|
||||||
Div(
|
|
||||||
Div(Field('name'),
|
|
||||||
css_class='col-sm-6',
|
|
||||||
style='width: 200px;'),
|
|
||||||
Div(StrictButton(_('Apply Theme'), css_class='btn btn-primary', type='submit'),
|
|
||||||
css_class='col-sm-6',
|
|
||||||
style='width: auto;'),
|
|
||||||
css_class='row',
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class SettingCategorySelectForm(forms.ModelForm):
|
class SettingCategorySelectForm(forms.ModelForm):
|
||||||
""" Form for setting category settings """
|
""" Form for setting category settings """
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ from users.models import check_user_role, RuleSet
|
|||||||
import InvenTree.tasks
|
import InvenTree.tasks
|
||||||
|
|
||||||
from .forms import DeleteForm, EditUserForm, SetPasswordForm
|
from .forms import DeleteForm, EditUserForm, SetPasswordForm
|
||||||
from .forms import ColorThemeSelectForm, SettingCategorySelectForm
|
from .forms import SettingCategorySelectForm
|
||||||
from .helpers import str2bool
|
from .helpers import str2bool
|
||||||
|
|
||||||
from rest_framework import views
|
from rest_framework import views
|
||||||
|
Loading…
Reference in New Issue
Block a user