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

A bug that advanced search processing might fail #42

Closed
userlocalhost opened this issue Oct 11, 2020 · 1 comment
Closed

A bug that advanced search processing might fail #42

userlocalhost opened this issue Oct 11, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@userlocalhost
Copy link
Member

userlocalhost commented Oct 11, 2020

There is a bug that internal error would be happened by following procedures.

  1. Create an Entity "E1" with an "array_string" typed attribute that is named by "attr".
  2. Create an Entry "e1" and set arbitrary value to attribute "attr".
  3. Edit Entity "E1" and delete attribute "attr", then save it.
  4. Edit Entity "E1" and add a "string" typed attribute that is named by "attr".
  5. Edit Entry "e1" and save it without any input.
  6. Send request of advanced search of "E1" with attribute "attr".

After the procedure (6) following exception would be happened.

Internal Server Error: /dashboard/advanced_search_result
Traceback (most recent call last):
  File "/home/user/airone/virtualenv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/user/airone/virtualenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/user/airone/virtualenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/user/airone/airone/lib/http.py", line 35, in wrapper
    return func(*args, **kwargs)
  File "/home/user/airone/airone/lib/profile.py", line 29, in wrapper
    ret = func(*args, **kwargs)
  File "/home/user/airone/dashboard/views.py", line 175, in advanced_search_result
    print('(%s|%s) %s' % (name, val['value'].__class__.__name__, val['value']))
KeyError: 'value'
[ERROR] asctime:2020-10-12 00:24:59,494 module:basehttp message:"GET /dashboard/advanced_search_result?has_referral=false&is_all_entities=false&attr[]=date&attr[]=date2&entity[]=2175735 HTTP/1.1" 500 87837   process:21295   thread:140670217373440
@userlocalhost userlocalhost added the bug Something isn't working label Oct 11, 2020
@userlocalhost userlocalhost self-assigned this Oct 11, 2020
@userlocalhost
Copy link
Member Author

print('(%s|%s) %s' % (name, val['value'].class.name, val['value']))

I close it because that is because of my test environment debug code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant