On Oct 5, 2006, at 1:32 PM, Bas van der Vlies wrote:

>
> With email2trac we convert emails to tickets and if an email has
> attachments it is automatically added to the ticket. But is just  
> noticed
> that the author is never set when an attachmnet is added.
>
> In versions pre 0.9 i just excuted SQL-statements with the proper  
> values.
> Now i use this functions:
>   fd = open(path)
>   att = attachment.Attachment(self.env, 'ticket', ticket['id'])
>   att.insert(url_filename, fd, filesize)
>   fd.close()
>
> This does not set the author name. Do i something wrong or there  
> another
> way to accomplish this?
>
>

Thanks to Matthew Good for the hint.  I forgot the simple  
solution ;-). This is the way to accomplish this:
    att = attachment.Attachment(self.env, 'ticket', ticket['id'])
    att.author = 'author'
    att.insert(url_filename, fd, filesize)


Thanks
--
Bas van der Vlies
[EMAIL PROTECTED]




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/trac-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to