mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
8040ad8a6a
commit
456164f1d9
@ -10,7 +10,7 @@ def str2bool(text, test=True):
|
|||||||
if test:
|
if test:
|
||||||
return str(text).lower() in ['1', 'y', 'yes', 't', 'true', 'ok', ]
|
return str(text).lower() in ['1', 'y', 'yes', 't', 'true', 'ok', ]
|
||||||
else:
|
else:
|
||||||
return str(text).lower() in ['0', 'n', 'no', 'none', 'f', 'false',]
|
return str(text).lower() in ['0', 'n', 'no', 'none', 'f', 'false', ]
|
||||||
|
|
||||||
|
|
||||||
def WrapWithQuotes(text):
|
def WrapWithQuotes(text):
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from rest_framework.exceptions import ValidationError
|
from rest_framework.exceptions import ValidationError
|
||||||
|
from .helpers import str2bool
|
||||||
|
|
||||||
from django.db.models.signals import pre_delete
|
from django.db.models.signals import pre_delete
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
@ -50,7 +50,7 @@ class PartCreate(AjaxCreateView):
|
|||||||
"""
|
"""
|
||||||
model = Part
|
model = Part
|
||||||
form_class = EditPartForm
|
form_class = EditPartForm
|
||||||
|
|
||||||
ajax_form_title = 'Create new part'
|
ajax_form_title = 'Create new part'
|
||||||
ajax_template_name = 'modal_form.html'
|
ajax_template_name = 'modal_form.html'
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ class PartCreate(AjaxCreateView):
|
|||||||
initials = super(PartCreate, self).get_initial()
|
initials = super(PartCreate, self).get_initial()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
initials = super(PartCreate, self).get_initial()
|
initials = super(PartCreate, self).get_initial()
|
||||||
|
|
||||||
if self.get_category_id():
|
if self.get_category_id():
|
||||||
initials['category'] = get_object_or_404(PartCategory, pk=self.get_category_id())
|
initials['category'] = get_object_or_404(PartCategory, pk=self.get_category_id())
|
||||||
|
Loading…
Reference in New Issue
Block a user