Skip to content

Commit

Permalink
better type support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 12, 2017
1 parent f059aa5 commit fe0dc06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/appier_extras/parts/prismic/partials/_prismic.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ def _prismic_deref(cls, entry):
# value as the "master" value for it
type = entry["type"]
values = entry["value"]
value = values[0] if values else dict()

if type == "StructuredText":
return value["text"]
return "\n".join([value["text"] for value in values])

if type == "Text":
return values

if type == "Image":
value = values[0] if values else dict()
return value["main"]["url"]

if type == "Group":
Expand Down

0 comments on commit fe0dc06

Please sign in to comment.