Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 8d11161

Browse files
committed
Return empty array for media.tags if tags do not exist instead of AttributeError
1 parent e885e7d commit 8d11161

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

instagram/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def object_from_dictionary(cls, entry):
107107
new_media.caption = None
108108
if entry['caption']:
109109
new_media.caption = Comment.object_from_dictionary(entry['caption'])
110-
110+
111+
new_media.tags = []
111112
if entry['tags']:
112-
new_media.tags = []
113113
for tag in entry['tags']:
114114
new_media.tags.append(Tag.object_from_dictionary({'name': tag}))
115115

0 commit comments

Comments
 (0)