From 14a8103ff3646e30e131c53b5d7538ccbf7aa09f Mon Sep 17 00:00:00 2001 From: Marek Marecki Date: Fri, 29 Mar 2013 12:16:45 +0100 Subject: [PATCH] get_mailbox() refactored to use _sessionget() --- diaspy/client.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 -- 2.25.1