From: Marek Marecki Date: Fri, 29 Mar 2013 11:16:45 +0000 (+0100) Subject: get_mailbox() refactored to use _sessionget() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=14a8103ff3646e30e131c53b5d7538ccbf7aa09f;p=diaspy.git get_mailbox() refactored to use _sessionget() --- diff --git a/diaspy/client.py b/diaspy/client.py index 5569359..bf3ddd9 100644 --- a/diaspy/client.py +++ b/diaspy/client.py @@ -279,16 +279,13 @@ class Client: :returns: list -- list of Conversation objects. """ data = {'authenticity_token': self.get_token()} - #r = self.session.get('{0}/conversations.json'.format(self.pod)) - r = self.session.get('{0}/conversations.json'.format(self.pod)) + r = self._sessionget('conversations.json') if r.status_code != 200: raise Exception('wrong status code: {0}'.format(r.status_code)) mailbox = r.json() - conversations = [ diaspy.conversations.Conversation(str(conversation['conversation']['id']), self) for conversation in mailbox ] - - return conversations + return [ diaspy.conversations.Conversation(str(conversation['conversation']['id']), self) for conversation in mailbox ] def new_conversation(self, contacts, subject, text): """ start a new conversation