Storing values from checkboxes in database
You can use the default parameter from the get method.
Reference

if request.POST:
        user.is_staff = request.POST.get('is_staff', False)
        user.is_active = request.POST.get('is_active', False)
        user.save()