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:
Adi Sieker
2011-05-19 23:18:44 +02:00
parent c50b67265f
commit dd0c6f906d
2 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -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
View File
@@ -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)