Commit f21603bdcdfa74d140dc29d75367f3e47f4063e5
Exists in
master
and in
27 other branches
Merge branch 'fixed_noosfero_data_api' into 'master'
Fixed noosfero data api See merge request !95
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
colab/plugins/noosfero/data_importer.py
| ... | ... | @@ -67,6 +67,9 @@ class NoosferoDataImporter(PluginDataImporter): |
| 67 | 67 | def fetch_communities(self): |
| 68 | 68 | json_data = self.get_json_data('/api/v1/communities', 1) |
| 69 | 69 | |
| 70 | + if len(json_data) == 0: | |
| 71 | + return | |
| 72 | + | |
| 70 | 73 | json_data = json_data['communities'] |
| 71 | 74 | for element in json_data: |
| 72 | 75 | community = NoosferoCommunity() |
| ... | ... | @@ -82,6 +85,9 @@ class NoosferoDataImporter(PluginDataImporter): |
| 82 | 85 | def fetch_articles(self): |
| 83 | 86 | json_data = self.get_json_data('/api/v1/articles', 1) |
| 84 | 87 | |
| 88 | + if len(json_data) == 0: | |
| 89 | + return | |
| 90 | + | |
| 85 | 91 | json_data = json_data['articles'] |
| 86 | 92 | |
| 87 | 93 | for element in json_data: | ... | ... |