Skip to content

Commit

Permalink
travis
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb committed Sep 3, 2017
1 parent 01a68f9 commit 53e9098
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions survey_answer_once/controllers/website_survey.py
Expand Up @@ -30,7 +30,9 @@ def submit(self, survey, **post):
except ValidationError as e:
if len(e.args) == 2:
if e.args[1] == 'duplicate_answer':
return json.dumps(dict(redirect='/survey/already-answered'))
return json.dumps(dict(
redirect='/survey/already-answered'))
if e.args[1] == 'disallow_invite':
return json.dumps(dict(redirect='/survey/disallow-invite'))
return json.dumps(dict(
redirect='/survey/disallow-invite'))
raise
7 changes: 4 additions & 3 deletions survey_answer_once/models/survey_survey.py
Expand Up @@ -24,7 +24,8 @@ def create(self, vals):
partner_id = self.env.user.partner_id.id
question_id = vals.get('question_id')
survey = self.env['survey.survey'].browse(vals.get('survey_id'))
user_input = self.env['survey.user_input'].browse(vals.get('user_input_id'))
user_input = self.env['survey.user_input'].browse(
vals.get('user_input_id'))
_logger.info(
_("User '%s' (%d, partner %d) filled survey %d question %d"),
self.env.user.name,
Expand All @@ -42,7 +43,7 @@ def create(self, vals):
if alt_partner_id and alt_partner_id != partner_id:
partner_id = alt_partner_id
_logger.info(
_("User input object says this is user with partner id %d"),
_("User input object says partner id is %d"),
partner_id
)
else:
Expand All @@ -60,4 +61,4 @@ def create(self, vals):
_logger.info(
_('Disallowing, because we found existing answers.'))
raise ValidationError(_('duplicate_answer'))
return super(SurveyUserInputLine, self).create(vals)
return super(SurveyUserInputLine, self).create(vals)

0 comments on commit 53e9098

Please sign in to comment.