[imp]:improve remove tag as space in ask question and edit question

bzr revid: ssh@tinyerp.com-20140407133509-cmeyb8xt7z9xkuaj
This commit is contained in:
Sunil Sharma 2014-04-07 19:05:09 +05:30
parent 847d0a9408
commit 1aee6d631b
1 changed files with 12 additions and 11 deletions

View File

@ -308,8 +308,9 @@ class website_forum(http.Controller):
create_context = dict(context)
Tag = request.registry['website.forum.tag']
tags = question.get('question_tags').strip('[]').replace('"','').split(",")
question_tags = []
if question.get('question_tags').strip('[]'):
tags = question.get('question_tags').strip('[]').replace('"','').split(",")
for tag in tags:
tag_ids = Tag.search(cr, uid, [('name', '=', tag)], context=context)
if tag_ids:
@ -396,10 +397,10 @@ class website_forum(http.Controller):
vals = {
'content': post.get('content'),
}
if post.get('question_tag'):
question_tags = []
if post.get('question_tag').strip('[]'):
Tag = request.registry['website.forum.tag']
tags = post.get('question_tag').strip('[]').replace('"','').split(",")
question_tags = []
for tag in tags:
tag_ids = Tag.search(cr, uid, [('name', '=', tag)], context=context)
if tag_ids: