mirror of
https://github.com/kennethreitz-archive/python-convore.git
synced 2026-06-05 23:40:18 +00:00
fixed the last remanants of the old api.get calls.
in the initial commit I missed 2 places of the old api calls. I was also passing in the wrong dict to Groups.import_from_api
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@ class Groups(ConvoreSyncedList):
|
||||
|
||||
def get(self, key):
|
||||
data = self.endpoints.call(self.endpoints.group_detail, group_id=key)
|
||||
group = self._create_group_from_api(data)
|
||||
group = self._create_group_from_api(data["group"])
|
||||
return group
|
||||
|
||||
def sync(self):
|
||||
|
||||
+3
-6
@@ -92,7 +92,7 @@ class GroupDiscoverCategory(SyncedList):
|
||||
|
||||
error = 'Invalid group slug given.'
|
||||
|
||||
r = self.endpoints.call(api.Endpoints.discover_groups_by_category, category_slug=key)
|
||||
r = api.Endpoints.discover_groups_by_category.call(category_slug=key)
|
||||
|
||||
groups = r['groups']
|
||||
|
||||
@@ -103,11 +103,8 @@ class GroupDiscoverCategory(SyncedList):
|
||||
|
||||
|
||||
def sync(self):
|
||||
r = self.endpoints.call(api.Endpoints.discover_categories)
|
||||
r = api.get('groups', 'discover', 'category')
|
||||
for _cat in deserialize(r.content)['categories']:
|
||||
r = api.Endpoints.discover_categories.call()
|
||||
for _cat in r['categories']:
|
||||
cat = models.Category()
|
||||
cat.import_from_api(_cat)
|
||||
self.data.append(cat)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user