Restrict autoform __init__ patch to SEDA entities
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 25 Oct 2016 14:13:49 +0200
changeset 1955 b037d7f88660
parent 1954 541862167735
child 1956 d6df3fe381be
Restrict autoform __init__ patch to SEDA entities
views/patches.py
--- a/views/patches.py	Mon Oct 24 11:08:09 2016 +0200
+++ b/views/patches.py	Tue Oct 25 14:13:49 2016 +0200
@@ -29,7 +29,7 @@
 @monkeypatch(autoform.AutomaticEntityForm)
 def __init__(self, *args, **kwargs):
     orig_autoform_init(self, *args, **kwargs)
-    if 'peid' not in kwargs:  # main form
+    if 'peid' not in kwargs and self.edited_entity.cw_etype.startswith('SEDA'):  # main form
         parent = None
         if self.edited_entity.has_eid():
             parent = self.edited_entity