File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -208,16 +208,13 @@ def _impl_live_preview(self):
208208 def _merged_response (self ):
209209 if 'entry_response' in self .http_instance .live_preview and 'lp_response' in self .http_instance .live_preview :
210210 entry_response = self .http_instance .live_preview ['entry_response' ]
211- lp_response = self .http_instance .live_preview ['lp_response' ]
212-
213211 # Ensure lp_entry exists
214- if 'entry' in lp_response :
215- lp_entry = lp_response ['entry' ]
212+ if 'entry' in self . http_instance . live_preview . get ( ' lp_response' , {}) :
213+ lp_entry = self . http_instance . live_preview [ ' lp_response' ] ['entry' ]
216214 else :
217- raise KeyError (f"'entry' key not found in lp_response: { lp_response } " )
218- # 🛠️ Fix: Ensure both are lists of dictionaries
215+ lp_entry = {}
219216 if not isinstance (entry_response , list ):
220- entry_response = [entry_response ] # Wrap in a list if it's a dict
217+ entry_response = [entry_response ]
221218 if not isinstance (lp_entry , list ):
222219 lp_entry = [lp_entry ] # Wrap in a list if it's a dict
223220 if not all (isinstance (item , dict ) for item in entry_response ):
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ def _impl_live_preview(self):
355355
356356 if lp_resp and 'error_code' not in lp_resp :
357357 if 'entry' in lp_resp :
358- self .http_instance .live_preview ['lp_response' ] = lp_resp ['entry' ] # Extract entry
358+ self .http_instance .live_preview ['lp_response' ] = { 'entry' : lp_resp ['entry' ]} # Extract entry
359359 else :
360360 print (f"Warning: Missing 'entry' key in lp_response: { lp_resp } " )
361361 return None
You can’t perform that action at this time.
0 commit comments