Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force_insert validation requires bool #91

Open
azaroth42 opened this issue Jul 22, 2024 · 1 comment
Open

force_insert validation requires bool #91

azaroth42 opened this issue Jul 22, 2024 · 1 comment

Comments

@azaroth42
Copy link

Task

Trying to change the backend autocomplete defaults from 3. context sensitive to 2. context insensitive results in the following exception.

Update: Actually even trying to resubmit any change has the same issue.

Exception Generated

Traceback (most recent call last):
  File "/env/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/env/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/options.py", line 714, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/utils/decorators.py", line 188, in _view_wrapper
    result = _process_exception(request, e)
  File "/env/lib/python3.10/site-packages/django/utils/decorators.py", line 186, in _view_wrapper
    response = view_func(request, *args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper
    response = view_func(request, *args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 240, in inner
    return view(request, *args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1944, in change_view
    return self.changeform_view(request, object_id, form_url, extra_context)
  File "/env/lib/python3.10/site-packages/django/utils/decorators.py", line 48, in _wrapper
    return bound_method(*args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/utils/decorators.py", line 188, in _view_wrapper
    result = _process_exception(request, e)
  File "/env/lib/python3.10/site-packages/django/utils/decorators.py", line 186, in _view_wrapper
    response = view_func(request, *args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1802, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1853, in _changeform_view
    self.save_model(request, new_object, form, not add)
  File "/env/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1257, in save_model
    obj.save()
  File "/app/backend/models.py", line 466, in save
    super(BackendDefaults, self).save(*args, kwargs)
  File "/app/backend/models.py", line 341, in save
    super(Backend, self).save(*args, **kwargs)
  File "/env/lib/python3.10/site-packages/django/db/models/base.py", line 814, in save
    self.save_base(
  File "/env/lib/python3.10/site-packages/django/db/models/base.py", line 897, in save_base
    force_insert = self._validate_force_insert(force_insert)
  File "/env/lib/python3.10/site-packages/django/db/models/base.py", line 842, in _validate_force_insert
    raise TypeError("force_insert must be a bool or tuple.")

Exception Type: TypeError at /admin/backend/backenddefaults/36/change/
Exception Value: force_insert must be a bool or tuple.

Environment

From the UI: Git commit 27a4c98 on master
Started via qlever ui

@hannahbast
Copy link
Member

@azaroth42 I am seeing this only now, sorry. Can you tell me what exactly you did. In particular, did you change this in the web interface (after clicking on "Edit this backend") or did you change this somewhere in the code? And did the error message appear in the browser or on the command line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants