/api/documents/{id}/cabinets returns 500

Anything concerning integration via the REST API
Post Reply
jere
Posts: 8
Joined: Thu Jun 13, 2019 2:02 pm

/api/documents/{id}/cabinets returns 500

Post by jere »

Whether the document specified belongs to no cabinets or one or many, the api call returns a 500 error.

The following error shows up in the logs:

Code: Select all

mayan.apps.common.middleware.error_logging <213> [ERROR] "process_exception() line 18 Exception caught by request middleware; <WSGIRequest: GET '/api/documents/13/cabinets/?format=json'>, 'Document' object has no attribute 'get_cabinets'"
 
Traceback (most recent call last):
File "/opt/mayan-edms/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/rest_framework/views.py", line 494, in dispatch
response = self.handle_exception(exc)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/rest_framework/views.py", line 454, in handle_exception
self.raise_uncaught_exception(exc)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/rest_framework/views.py", line 491, in dispatch
response = handler(request, *args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/rest_framework/generics.py", line 201, in get
return self.list(request, *args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/rest_framework/mixins.py", line 40, in list
queryset = self.filter_queryset(self.get_queryset())
File "/opt/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/cabinets/api_views.py", line 42, in get_queryset
queryset = document.get_cabinets()
AttributeError: 'Document' object has no attribute 'get_cabinets'

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: /api/documents/{id}/cabinets returns 500

Post by rosarior »

Thanks for the report! Added to the work list for the the next bugfix release.

jere
Posts: 8
Joined: Thu Jun 13, 2019 2:02 pm

Re: /api/documents/{id}/cabinets returns 500

Post by jere »

3.2.7 fixed this. Thank you.

Post Reply