check entity has an eid before using absolute_url stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 18 Dec 2009 13:28:20 +0100
branchstable
changeset 4134 40624a708dd4
parent 4133 24ffe983abfc
child 4148 748454627176
check entity has an eid before using absolute_url
web/views/forms.py
--- a/web/views/forms.py	Fri Dec 18 13:02:13 2009 +0100
+++ b/web/views/forms.py	Fri Dec 18 13:28:20 2009 +0100
@@ -297,7 +297,7 @@
             return self.force_session_key
         # XXX if this is a json request, suppose we should redirect to the
         # entity primary view
-        if self.req.json_request:
+        if self.req.json_request and self.edited_entity.has_eid():
             return '%s#%s' % (self.edited_entity.absolute_url(), self.domid)
         return '%s#%s' % (self.req.url(), self.domid)