[IMP] used formatted string with % for url

bzr revid: dizzy.zala@gmail.com-20140324123019-bcnlwgfo3z3f83j1
This commit is contained in:
Dharmraj Jhala (OpenERP) 2014-03-24 18:00:19 +05:30
parent 6a0fa7c3ff
commit eec4143d7a
2 changed files with 3 additions and 5 deletions

View File

@ -266,9 +266,7 @@ class WebsiteSurvey(http.Controller):
else:
vals.update({'state': 'skip'})
user_input_obj.write(cr, uid, user_input_id, vals, context=context)
ret['redirect'] = '/survey/fill/%s/%s' % (survey.id, post['token'])
if go_back:
ret['redirect'] += '/prev'
ret['redirect'] = '/survey/fill/%s/%s%s' % (survey.id, post['token'],'/prev' if go_back else '')
return json.dumps(ret)
# Printing routes

View File

@ -290,7 +290,7 @@ class survey_survey(osv.Model):
''' Open the website page with the survey form '''
trail = ""
if context and 'survey_token' in context:
trail = "/" + context['survey_token']
trail = "/%s" % (context['survey_token'])
return {
'type': 'ir.actions.act_url',
'name': "Start Survey",
@ -339,7 +339,7 @@ class survey_survey(osv.Model):
''' Open the website page with the survey printable view '''
trail = ""
if context and 'survey_token' in context:
trail = "/" + context['survey_token']
trail = "/%s" % (context['survey_token'])
return {
'type': 'ir.actions.act_url',
'name': "Print Survey",