summaryrefslogtreecommitdiff
path: root/addons/gamification/wizard
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-12-18 14:00:39 +0100
committerMartin Trigaux <mat@openerp.com>2013-12-18 14:00:39 +0100
commit938a07a3610337e4aafebdc334aef33d9bcf152f (patch)
tree87fcfbee7b550ca7327f32f3c0a934f4912f5ff6 /addons/gamification/wizard
parent553e85f369a1383a91e9e10f4237434d1d523a27 (diff)
[FIX] gamification: check grant badges are now sistematic except for superuser (always possible)
bzr revid: mat@openerp.com-20131218130039-y5vp0wt48ejd3jrh
Diffstat (limited to 'addons/gamification/wizard')
-rw-r--r--addons/gamification/wizard/grant_badge.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/addons/gamification/wizard/grant_badge.py b/addons/gamification/wizard/grant_badge.py
index 725512a55bb..e100b2dce29 100644
--- a/addons/gamification/wizard/grant_badge.py
+++ b/addons/gamification/wizard/grant_badge.py
@@ -43,16 +43,13 @@ class grant_badge_wizard(osv.TransientModel):
if uid == wiz.user_id.id:
raise osv.except_osv(_('Warning!'), _('You can not grant a badge to yourself'))
- #check if the badge granting is legitimate
- if badge_obj.check_granting(cr, uid, user_from_id=uid, badge_id=wiz.badge_id.id, context=context):
- #create the badge
- values = {
- 'user_id': wiz.user_id.id,
- 'badge_id': wiz.badge_id.id,
- 'comment': wiz.comment,
- }
- badge_user = badge_user_obj.create(cr, uid, values, context=context)
- #notify the user
- result = badge_obj.send_badge(cr, uid, wiz.badge_id.id, [badge_user], user_from=uid, context=context)
+ #create the badge
+ values = {
+ 'user_id': wiz.user_id.id,
+ 'badge_id': wiz.badge_id.id,
+ 'comment': wiz.comment,
+ }
+ badge_user = badge_user_obj.create(cr, uid, values, context=context)
+ result = badge_obj._send_badge(cr, uid, badge_user, user_from=uid, context=context)
return result