File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,15 @@ def has_gist_block(value):
99
99
for block in value ._raw_data :
100
100
# special case for work page section block as the streamfields are nested within sections
101
101
if block ["type" ] == "section" :
102
- for sub_block in block ["value" ]["content" ]:
103
- if (
104
- sub_block ["type" ] == "raw_html"
105
- and "https://gist.github.com" in sub_block ["value" ]
106
- ):
107
- return True
102
+ try :
103
+ for sub_block in block ["value" ]["content" ]:
104
+ if (
105
+ sub_block ["type" ] == "raw_html"
106
+ and "https://gist.github.com" in sub_block ["value" ]
107
+ ):
108
+ return True
109
+ except (KeyError , TypeError ):
110
+ pass
108
111
109
112
if block ["type" ] == "raw_html" and "https://gist.github.com" in block ["value" ]:
110
113
return True
@@ -117,10 +120,14 @@ def has_markdown_block(value):
117
120
return False
118
121
119
122
for block in value ._raw_data :
120
- # special case for work page section block as the streamfields are nested within sections
121
123
if block ["type" ] == "section" :
122
- for sub_block in block ["value" ]["content" ]:
123
- if sub_block ["type" ] == "markdown" :
124
- return True
124
+ try :
125
+ for sub_block in block ["value" ]["content" ]:
126
+ if sub_block ["type" ] == "markdown" :
127
+ return True
128
+ except (KeyError , TypeError ):
129
+ pass
125
130
if block ["type" ] == "markdown" :
126
131
return True
132
+
133
+ return False
You can’t perform that action at this time.
0 commit comments