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

fix exception #381

Closed
carlosp420 opened this issue Feb 2, 2018 · 1 comment
Closed

fix exception #381

carlosp420 opened this issue Feb 2, 2018 · 1 comment

Comments

@carlosp420
Copy link
Member

[2018-02-01 10:19:45,075] [ERROR] [MainThread] [django.request] [124] Internal Server Error: /search/
Traceback (most recent call last):
  File "/home/voseq/.virtualenvs/voseq/lib/python3.4/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/home/voseq/.virtualenvs/voseq/lib/python3.4/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/voseq/.virtualenvs/voseq/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/voseq/.virtualenvs/voseq/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/voseq/VoSeq/voseq/public_interface/views.py", line 102, in search
    'voucher_code_list': get_voucher_code_list(sqs),
  File "/home/voseq/VoSeq/voseq/public_interface/utils.py", line 48, in get_voucher_code_list
    code = sqs[0].code
  File "/home/voseq/.virtualenvs/voseq/lib/python3.4/site-packages/django/db/models/query.py", line 295, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
@carlosp420
Copy link
Member Author

This error is triggered when doing a simple search and searching for a voucher code that doses not exist in the database.

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