SpriteLink / NIPAP

Neat IP Address Planner - NIPAP is the best open source IPAM in the known universe, challenging classical IP address management (IPAM) systems in many areas.
https://spritelink.github.io/NIPAP/
MIT License
537 stars 132 forks source link

www: Fix KeyError in xhr.py #1335

Closed jplitza closed 1 year ago

jplitza commented 1 year ago

I got this exception for several versions now:

ERROR in app: Exception on /xhr/smart_search_prefix [POST]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/nipap_www-0.31.1-py2.7.egg/nipapwww/auth.py", line 23, in wrapped_view
    return view(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nipap_www-0.31.1-py2.7.egg/nipapwww/xhr.py", line 542, in smart_search_prefix
    search_options, extra_query)
KeyError: 'error'
garberg commented 1 year ago

Amazing I never noticed. Thanks for contributing!