summaryrefslogtreecommitdiff
path: root/addons/gamification/models
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2017-05-10 16:34:36 +0200
committerXavier Morel <xmo@odoo.com>2017-05-12 16:15:40 +0200
commit07ab8b6cd2b44aeb91dadc35adf5f4b19f1399b2 (patch)
treee11bc7b07e68ff4ee0a07c1a786abd2f3abe27a8 /addons/gamification/models
parent3dd3790597e84186d922b798aa8bb4650513ce4b (diff)
[FIX] P3: Exception.message removed
Diffstat (limited to 'addons/gamification/models')
-rw-r--r--addons/gamification/models/goal.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 89f037d55d3..56c447dd9d4 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -87,7 +87,9 @@ class GoalDefinition(models.Model):
# dummy search to make sure the domain is valid
Obj.search_count(domain)
except (ValueError, SyntaxError) as e:
- msg = e.message or (e.msg + '\n' + e.text)
+ msg = e
+ if isinstance(e, SyntaxError):
+ msg = (e.msg + '\n' + e.text)
raise exceptions.UserError(_("The domain for the definition %s seems incorrect, please check it.\n\n%s") % (definition.name, msg))
return True
@@ -105,7 +107,7 @@ class GoalDefinition(models.Model):
_("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not stored") % (definition.name, definition.field_id.name))
except KeyError as e:
raise exceptions.UserError(
- _("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not found") % (definition.name, e.message))
+ _("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not found") % (definition.name, e))
@api.model
def create(self, vals):