diff MoinMoin/items/ticket.py @ 2713:c9baa61473a9

Now only tags specific to ticket items are shown in +tickets view and in ticket submit/modify view, added a function that returns itemtype specific tags
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Sun, 10 Aug 2014 01:59:26 +0530
parents c05ad337ac22
children 8bdd34c2cb74
line wrap: on
line diff
--- a/MoinMoin/items/ticket.py	Sun Aug 10 01:48:42 2014 +0530
+++ b/MoinMoin/items/ticket.py	Sun Aug 10 01:59:26 2014 +0530
@@ -25,9 +25,8 @@
 from MoinMoin.constants.keys import (ITEMTYPE, CONTENTTYPE, ITEMID, CURRENT,
                                      SUPERSEDED_BY, SUBSCRIPTIONS, DEPENDS_ON, NAME, SUMMARY)
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
-from MoinMoin.items import Item, Contentful, register, BaseModifyForm
+from MoinMoin.items import Item, Contentful, register, BaseModifyForm, get_itemtype_specific_tags
 from MoinMoin.items.content import NonExistentContent
-from MoinMoin.constants.keys import LATEST_REVS, TAGS
 
 
 ITEMTYPE_TICKET = u'ticket'
@@ -194,15 +193,15 @@
 
         # 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())
-        with flaskg.storage.indexer.ix[LATEST_REVS].searcher() as searcher:
-            suggested_tags = list(searcher.field_terms(TAGS))
 
-            return render_template(self.submit_template if is_new else self.modify_template,
-                                   is_new=is_new,
-                                   closed=closed,
-                                   item_name=self.name,
-                                   data_rendered=data_rendered,
-                                   form=form,
-                                   suggested_tags=suggested_tags,
-                                   item=self,
-                                  )
+        suggested_tags = get_itemtype_specific_tags(ITEMTYPE_TICKET)
+
+        return render_template(self.submit_template if is_new else self.modify_template,
+                               is_new=is_new,
+                               closed=closed,
+                               item_name=self.name,
+                               data_rendered=data_rendered,
+                               form=form,
+                               suggested_tags=suggested_tags,
+                               item=self,
+                              )