[PATCH 10 of 18 seda] [seda tree] Stop returning rset in reparent

Sylvain Thenault sylvain.thenault at logilab.fr
Mon Dec 11 16:53:42 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1512994952 -3600
#      Mon Dec 11 13:22:32 2017 +0100
# Node ID 5df3817c05103349712009ab02436427a834e031
# Parent  4a36c9d0df7bc5685b1ab3b599d7a83cd9b7f36c
[seda tree] Stop returning rset in reparent

this is not used (left-over of some debugging session?)

diff --git a/cubicweb_seda/views/jqtree.py b/cubicweb_seda/views/jqtree.py
--- a/cubicweb_seda/views/jqtree.py
+++ b/cubicweb_seda/views/jqtree.py
@@ -1,6 +1,6 @@
-# copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr -- mailto:contact at logilab.fr
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Lesser General Public License as published by the Free
 # Software Foundation, either version 2.1 of the License, or (at your option)
@@ -26,12 +26,12 @@ from cubicweb.web.views import ajaxcontr
 
 @ajaxcontroller.ajaxfunc(output_type='json')
 def jqtree_reparent(self, child_eid, parent_eid):
     child = self._cw.entity_from_eid(child_eid)
     adapted = child.cw_adapt_to('IJQTree')
-    if adapted is not None:
-        return adapted.reparent(parent_eid)
+    assert adapted is not None
+    adapted.reparent(parent_eid)
 
 
 class IJQTreeAdapter(EntityAdapter):
     """Adapt an entity into a JQTree node."""
     __abstract__ = True
diff --git a/cubicweb_seda/views/sedatree.py b/cubicweb_seda/views/sedatree.py
--- a/cubicweb_seda/views/sedatree.py
+++ b/cubicweb_seda/views/sedatree.py
@@ -1,6 +1,6 @@
-# copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr -- mailto:contact at logilab.fr
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Lesser General Public License as published by the Free
 # Software Foundation, either version 2.1 of the License, or (at your option)
@@ -76,11 +76,10 @@ class ArchiveUnitIJQTreeAdapter(jqtree.I
             assert parent.cw_etype == 'SEDAArchiveTransfer', (
                 'cannot re-parent to entity type {0}'.format(parent.cw_etype))
         rset = self._cw.execute(
             'SET X seda_archive_unit P WHERE X eid %(x)s, P eid %(p)s',
             {'x': self.entity.eid, 'p': parent.eid})
-        return rset.rows
 
 
 class SimplifiedArchiveUnitIJQTreeAdapter(ArchiveUnitIJQTreeAdapter):
     __select__ = ArchiveUnitIJQTreeAdapter.__select__ & simplified_profile()
 
@@ -111,6 +110,5 @@ class SimplifiedBinaryDataObjectIJQTreeA
         rset = self._cw.execute(
             'SET REF seda_data_object_reference SEQ WHERE'
             ' REF seda_data_object_reference_id X,'
             ' X eid %(x)s, SEQ eid %(seq)s',
             {'x': self.entity.eid, 'seq': parent.eid})
-        return rset.rows


More information about the saem-devel mailing list