changeset 2731:efb94e228614

Now user is redirected to updated ticket after clicking ticket update button in ticket view
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Fri, 15 Aug 2014 22:17:30 +0530
parents cb7664022b31
children cadd7e64a7e0
files MoinMoin/items/ticket.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/ticket.py	Fri Aug 15 20:59:17 2014 +0530
+++ b/MoinMoin/items/ticket.py	Fri Aug 15 22:17:30 2014 +0530
@@ -23,10 +23,11 @@
                             Reference, BackReference, SelectSubmit, Text)
 from MoinMoin.storage.middleware.protecting import AccessDenied
 from MoinMoin.constants.keys import (ITEMTYPE, CONTENTTYPE, ITEMID, CURRENT,
-                                     SUPERSEDED_BY, SUBSCRIPTIONS, DEPENDS_ON, NAME, SUMMARY)
+                                     SUPERSEDED_BY, SUBSCRIPTIONS, DEPENDS_ON, NAME, SUMMARY, NAMESPACE)
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
 from MoinMoin.items import Item, Contentful, register, BaseModifyForm, get_itemtype_specific_tags
 from MoinMoin.items.content import NonExistentContent
+from MoinMoin.util.interwiki import CompositeName
 
 
 ITEMTYPE_TICKET = u'ticket'
@@ -189,7 +190,11 @@
                 except AccessDenied:
                     abort(403)
                 else:
-                    return redirect(url_for('.show_item', item_name=self.fqname))
+                    try:
+                        fqname = CompositeName(self.meta[NAMESPACE], ITEMID, self.meta[ITEMID])
+                    except KeyError:
+                        fqname = self.fqname
+                    return redirect(url_for('.show_item', item_name=fqname))
 
         # XXX When creating new item, suppress the "foo doesn't exist. Create it?" dummy content
         data_rendered = None if is_new else Markup(self.content._render_data())