File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -189,10 +189,13 @@ def api_node_moved_view(self, request):
189189
190190 position = request .POST ['position' ]
191191
192- if isinstance (moved_id , integer_types ) and isinstance (target_id , integer_types ):
193- previous_parent_id = int (request .POST ['previous_parent_id' ]) or None
192+ if request .POST .get ('previous_parent_id' ):
193+ if isinstance (moved_id , integer_types ) and isinstance (target_id , integer_types ):
194+ previous_parent_id = int (request .POST ['previous_parent_id' ])
195+ else :
196+ previous_parent_id = request .POST ['previous_parent_id' ]
194197 else :
195- previous_parent_id = request . POST [ 'previous_parent_id' ] or None
198+ previous_parent_id = None
196199
197200 # Not using .non_polymorphic() so all models are downcasted to the derived model.
198201 # This causes the signal below to be emitted from the proper class as well.
You can’t perform that action at this time.
0 commit comments