opinkerfi / adagios

Adagios - Web Based Nagios Configuration
GNU Affero General Public License v3.0
327 stars 75 forks source link

/rest/pynag/json/get_object gives attribute error #124

Closed spil-sean closed 11 years ago

spil-sean commented 11 years ago

When using the webpage at /rest/pynag/json/get_object and a correct id an error is encountered. Error is below.

Environment:

Request Method: POST
Request URL: http://172.16.226.25/adagios/rest/pynag/json/get_object

Django Version: 1.4.5
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'adagios.objectbrowser',
 'adagios.rest',
 'adagios.misc',
 'adagios.status',
 'adagios.pnp']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware')

Traceback:
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  77.         return view_func(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/adagios/rest/views.py" in handle_request
  88.             result = item( **arguments )
File "/usr/lib/python2.7/site-packages/adagios/misc/helpers.py" in get_object
  83.     del o.objects

Exception Type: AttributeError at /rest/pynag/json/get_object
Exception Value: objects
palli commented 11 years ago

Thanks for the bug report. We always use get_objects() so this one was outdated. Should be fixed now.