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

ValueError: not enough values to unpack #133

Open
jayvdb opened this issue Jan 2, 2021 · 0 comments
Open

ValueError: not enough values to unpack #133

jayvdb opened this issue Jan 2, 2021 · 0 comments

Comments

@jayvdb
Copy link

jayvdb commented Jan 2, 2021

Describe the bug
When invalid args are given to URL field_choices/..., especially a model which doesnt include a ., the logic raises an exception.

This occurs for example when a smoke tester hits a server with lots of invalid requests in order to find bugs, including security problems.

To Reproduce
Steps to reproduce the behavior:

  1. Go to `field_choices/foobar/blah'
  2. See error

Expected behavior
A 400 error should occur indicating that the client request is invalid.

Additional context

Traceback (most recent call last):
  ...
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/braces/views/_forms.py", line 24, in dispatch
    return super(CsrfExemptMixin, self).dispatch(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/braces/views/_access.py", line 407, in dispatch
    request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/advanced_filters/views.py", line 34, in get
    app_label, model_name = model.split('.', 1)
ValueError: not enough values to unpack (expected 2, got 1)
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

1 participant