summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2014-03-13 15:21:06 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-03-13 15:21:06 (GMT)
commit656cc50f65327ec47231b3ff6f8947d3f3b202ca (patch)
tree879d3fce170c7d0d634be29435680c2b38f7888f
parent5a9641cd6ad13dd28d3267c48a888d3586bebd66 (diff)
downloadplone.dexterity-656cc50f65327ec47231b3ff6f8947d3f3b202ca.zip
plone.dexterity-656cc50f65327ec47231b3ff6f8947d3f3b202ca.tar.gz
plone.dexterity-656cc50f65327ec47231b3ff6f8947d3f3b202ca.tar.bz2
don't bother with immediate_view if we didn't get an object (#4468)
-rw-r--r--plone/dexterity/browser/add.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/plone/dexterity/browser/add.py b/plone/dexterity/browser/add.py
index 9be8ce4..950eea9 100644
--- a/plone/dexterity/browser/add.py
+++ b/plone/dexterity/browser/add.py
@@ -76,6 +76,8 @@ class DefaultAddForm(DexterityExtensibleForm, form.AddForm):
fti = getUtility(IDexterityFTI, name=self.portal_type)
container = aq_inner(self.context)
new_object = addContentToContainer(container, object)
+ if new_object is None:
+ return
if fti.immediate_view:
self.immediate_view = "%s/%s/%s" % (container.absolute_url(), new_object.id, fti.immediate_view,)