[IMP] mail: subscription: if no-one to (un)subscribe, already return. This is not
necessary for computation, but saves some browse / access right checking. bzr revid: tde@openerp.com-20140210115827-2y451i0edgve59mi
This commit is contained in:
@@ -1203,6 +1203,9 @@ class mail_thread(osv.AbstractModel):
|
||||
""" Add partners to the records followers. """
|
||||
if context is None:
|
||||
context = {}
|
||||
# not necessary for computation, but saves an access right check
|
||||
if not partner_ids:
|
||||
return True
|
||||
|
||||
mail_followers_obj = self.pool.get('mail.followers')
|
||||
subtype_obj = self.pool.get('mail.message.subtype')
|
||||
@@ -1261,6 +1264,9 @@ class mail_thread(osv.AbstractModel):
|
||||
|
||||
def message_unsubscribe(self, cr, uid, ids, partner_ids, context=None):
|
||||
""" Remove partners from the records followers. """
|
||||
# not necessary for computation, but saves an access right check
|
||||
if not partner_ids:
|
||||
return True
|
||||
user_pid = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
|
||||
if set(partner_ids) == set([user_pid]):
|
||||
self.check_access_rights(cr, uid, 'read')
|
||||
|
||||
Reference in New Issue
Block a user