Comment 25 for bug 424849

Revision history for this message
Graham Binns (gmb) wrote : Re: [Bug 424849] Re: Launchpad should batch attachment notification emails

On 27 April 2011 19:09, Brian Murray <email address hidden> wrote:
> Well the api requires a comment when adding an attachment so it doesn't
> seem that there is a way to modify apport to prevent multiple email
> messages.

Ah, see, here's the problem:

Internally `comment` can be either a string or an IMessage, which is
how we can theoretically have several attachments linked to one
comment. In the declaration for IBug, we see:

    @operation_parameters(
        data=Bytes(constraint=attachment_size_constraint),
        comment=Text(), filename=TextLine(), is_patch=Bool(),
        content_type=TextLine(), description=Text())
    @export_factory_operation(IBugAttachment, [])
    def addAttachment(owner, data, comment, filename, is_patch=False,
                      content_type=None, description=None):

So, the problem is that the API won't let you pass a message in to
addAttachment(). If we want to change that we should probably track it
elsewhere.