diff --git a/InvenTree/InvenTree/helpers.py b/InvenTree/InvenTree/helpers.py index 898bfa3658..d748ba4d2e 100644 --- a/InvenTree/InvenTree/helpers.py +++ b/InvenTree/InvenTree/helpers.py @@ -104,9 +104,9 @@ def str2bool(text, test=True): True if the text looks like the selected boolean value """ if test: - return str(text).lower() in ['1', 'y', 'yes', 't', 'true', 'ok', ] + return str(text).lower() in ['1', 'y', 'yes', 't', 'true', 'ok', 'on', ] else: - return str(text).lower() in ['0', 'n', 'no', 'none', 'f', 'false', ] + return str(text).lower() in ['0', 'n', 'no', 'none', 'f', 'false', 'off',] def WrapWithQuotes(text, quote='"'): diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 141da68af0..29431788f7 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -192,7 +192,7 @@ class PartCreate(AjaxCreateView): context['matches'] = matches # Check if the user has checked the 'confirm_creation' input - confirmed = request.POST.get('confirm_creation', False) + confirmed = str2bool(request.POST.get('confirm_creation', False)) if not confirmed: form.fields['confirm_creation'].widget = CheckboxInput()