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:
@ -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()
|
||||
|
Reference in New Issue
Block a user