You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When paginating through the confluence.client.Confluence.get_content() method I am running into a KeyError when trying to fetch the title field from a content response. The rest of the fields in content appear on that record and the rest of my application works just fine except for this one bad item. I feel like title should be a required field or at least be a blank string but now it just blows up in my face. I am running Confluence version 6.15.9
Traceback (most recent call last):
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/celery/app/trace.py", line 648, in __protected_call__returnself.run(*args, **kwargs)
File "/Users/jquick/Box/Projects/matrix/confluence_app/tasks.py", line 23, in confluence_spaces
confluence_space_content(space.key)
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/celery/local.py", line 191, in __call__returnself._get_current_object()(*a, **kw)
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/celery/app/trace.py", line 649, in __protected_call__return orig(self, *args, **kwargs)
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/celery/app/task.py", line 394, in __call__returnself.run(*args, **kwargs)
File "/Users/jquick/Box/Projects/matrix/confluence_app/tasks.py", line 31, in confluence_space_contentfor content in client.get_content(ctype, space_key, expand=['history']):
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/confluence/client.py", line 139, in _get_paged_resultsyield item_type(result)
File "/Users/jquick/.virtualenvs/matrix-7HUYJ2hm/lib/python3.6/site-packages/confluence/models/content.py", line 69, in __init__self.title = json['title'] # type:strKeyError: 'title'
The site I am pulling this from is private but here is response content (with some info scrubbed for privacy)
Got another problem, since self.title doesnt exist then line 97, in str will break. Suggest setting self.title = 'Untitled' as a default before inspecting json for a title
When paginating through the
confluence.client.Confluence.get_content()
method I am running into aKeyError
when trying to fetch thetitle
field from a content response. The rest of the fields in content appear on that record and the rest of my application works just fine except for this one bad item. I feel liketitle
should be a required field or at least be a blank string but now it just blows up in my face. I am running Confluence version 6.15.9The site I am pulling this from is private but here is response content (with some info scrubbed for privacy)
The text was updated successfully, but these errors were encountered: