[entities] Add missing selector to SEDAArchiveUnitIClonableAdapter
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 01 Mar 2017 08:01:04 +0100
changeset 2445 2577d5c14718
parent 2444 6dc0c6dbc771
child 2446 68d41b878667
[entities] Add missing selector to SEDAArchiveUnitIClonableAdapter and fix a typo in a comment
cubicweb_seda/entities/__init__.py
--- a/cubicweb_seda/entities/__init__.py	Tue Feb 28 22:41:46 2017 +0100
+++ b/cubicweb_seda/entities/__init__.py	Wed Mar 01 08:01:04 2017 +0100
@@ -19,6 +19,7 @@
 
 from logilab.common.registry import objectify_predicate
 
+from cubicweb.predicates import is_instance
 from cubicweb_compound.entities import IContainer, IContained, IClonableAdapter
 
 from .. import seda_profile_container_def
@@ -150,6 +151,7 @@
 
 class SEDAArchiveUnitIClonableAdapter(IClonableAdapter):
     """Cloning adapter for SEDA components."""
+    __select__ = is_instance('SEDAArchiveUnit')
     rtype = 'clone_of'
     skiprtypes = ()
 
@@ -158,7 +160,7 @@
         if clone.seda_archive_unit and (
                 clone.seda_archive_unit[0].cw_etype == 'SEDAArchiveTransfer'
                 or clone.seda_archive_unit[0].container[0].cw_etype == 'SEDAArchiveTransfer'):
-            # clone is parented to a transfer profile, we need to propery handle binary/physical
+            # clone is parented to a transfer profile, we need to properly handle binary/physical
             # data objects
             data_objects = self._cw.execute(
                 'Any X WHERE X is IN (SEDABinaryDataObject, SEDAPhysicalDataObject),'