2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Improve str2bool to validate checkbox return values

- A checked checkbox returns 'on' :|
This commit is contained in:
Oliver Walters
2019-05-11 18:06:17 +10:00
parent 2e5b0bc961
commit 19854b4709
2 changed files with 3 additions and 3 deletions

View File

@ -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()