# HG changeset patch # User Denis Laxalde # Date 1471356032 -7200 # Node ID 8f264d98d6fd830b8fab9b38206533d6ab8b121e # Parent dabbb2a4a49398b6873c334aec711ebf14746b43 [web] Clear "pending_others" session key after all relations got processed The RelationField appends data to "pending_others" key while processing its posted information, but this key may already have been removed by the edit controller. So remove the key from session data only when all "others" relations have been processed using a while loop. A test case would be nice, but I could not build one easily unfortunately. Closes #4354551. diff -r dabbb2a4a493 -r 8f264d98d6fd cubicweb/web/views/editcontroller.py --- a/cubicweb/web/views/editcontroller.py Wed Sep 28 11:06:28 2016 +0200 +++ b/cubicweb/web/views/editcontroller.py Tue Aug 16 16:00:32 2016 +0200 @@ -209,8 +209,10 @@ pending_inlined = req.data.pop('pending_inlined') assert not pending_inlined, pending_inlined # handle all other remaining relations now - for form_, field in req.data.pop('pending_others'): + while req.data['pending_others']: + form_, field = req.data['pending_others'].pop() self.handle_formfield(form_, field) + del req.data['pending_others'] # then execute rql to set all relations for querydef in self.relations_rql: self._cw.execute(*querydef)