← Back to team overview

openerp-india team mailing list archive

[Bug 1081101] Re: mail_thread.py hangs sometimes because of non empty list

 

Hi,

Could you please provide a little bit of context surrounding your bug
report, as well as a proper description.

Quoting the recommendations that are shown in the bug reporting form:

"
Please be as specific as possible, including:
1) Steps to reproduce the issue you have observed
2) The result you observed
3) The result you expected
4) The platform you are using (and browser version, if relevant)
5) The OpenERP version you are using (e.g. 6.1.1-20120910-233309), if possible including the specific revision (e.g. r.2824) if you use the source repositories.
"

** Changed in: openobject-addons
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1081101

Title:
  mail_thread.py hangs sometimes because of non empty list

Status in OpenERP Addons (modules):
  Incomplete

Bug description:
      def message_thread_followers(self, cr, uid, ids, context=None):
          """Returns a list of email addresses of the people following
             this thread, including the sender of each mail, and the
             people who were in CC of the messages, if any.
          """
          
          res = {}
          if isinstance(ids, (str, int, long)):
              ids = [long(ids)] # sometimes the result is [ None ]

          ids = [id for id in ids if id != None] # add this to remove
  None

          for thread in self.browse(cr, uid, ids, context=context):
              l = set()
              for message in thread.message_ids:
                  l.add((message.user_id and message.user_id.user_email) or '')
                  l.add(message.email_from or '')
                  l.add(message.email_cc or '')
              res[thread.id] = filter(None, l)
          return res


  
  ### the same holds for this part of the file mail_thread.py:

  
      def message_forward(self, cr, uid, model, thread_ids, msg, email_error=False, context=None):
          """Sends an email to all people following the given threads.
             The emails are forwarded immediately, not queued for sending,
             and not archived.

          :param str model: thread model
          :param list thread_ids: ids of the thread records
          :param msg: email.message.Message object to forward
          :param email_error: optional email address to notify in case
                              of any delivery error during the forward.
          :return: True
          """
          model_pool = self.pool.get(model)
          smtp_server_obj = self.pool.get('ir.mail_server')

  
          thread_ids = [id for id in thread_ids if id != None] # add this to remove None        
          
          for res in model_pool.browse(cr, uid, thread_ids, context=context):

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1081101/+subscriptions


References