From e4c9633a7f2abea6ed85641bff94fa23cb53b20d Mon Sep 17 00:00:00 2001 From: Marek Marecki Date: Sun, 23 Apr 2017 15:12:34 +0200 Subject: [PATCH] Fix fetching streams of other users --- diaspy/people.py | 2 +- diaspy/streams.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/diaspy/people.py b/diaspy/people.py index 4410c4f..5c49768 100644 --- a/diaspy/people.py +++ b/diaspy/people.py @@ -82,7 +82,7 @@ class User(): return '{0} ({1})'.format(self['handle'], self['guid']) def _fetchstream(self): - self.stream = Outer(self._connection, location='people/{0}.json'.format(self['guid'])) + self.stream = Outer(self._connection, guid=self['guid']) def _fetch(self, fetch): """Fetch user posts or data. diff --git a/diaspy/streams.py b/diaspy/streams.py index dc59c6b..4e29b30 100644 --- a/diaspy/streams.py +++ b/diaspy/streams.py @@ -221,6 +221,10 @@ class Outer(Generic): """Object used by diaspy.models.User to represent stream of other user. """ + def __init__(self, connection, guid, fetch=True): + location = 'people/{}/stream.json'.format(guid) + super().__init__(connection, location, fetch) + def _obtain(self, max_time=0): """Obtains stream from pod. """ -- 2.25.1