Mercurial > hg > bzconsole
changeset 54:39325717218d
attach comments
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 19 Sep 2013 10:55:13 -0700 |
parents | 8e245a01829d |
children | a5b7ea791f64 |
files | bzconsole/api.py setup.py |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/bzconsole/api.py Mon Sep 16 04:51:48 2013 -0700 +++ b/bzconsole/api.py Thu Sep 19 10:55:13 2013 -0700 @@ -180,10 +180,6 @@ assert self.username and self.password, "Must be authenticated" - if not description: - # fairly hacky :/ - description = attachment - # read contents if '://' in attachment: # URL @@ -200,6 +196,8 @@ else: # TODO: better content_type content_type = 'text/plain' + if not description: + description = basename # patch flags flags = [] @@ -225,6 +223,8 @@ 'is_private': False, 'size': len(contents) } + if comment: + attachment['comments'] = [self._comment(comment)] return self._request('/bug/%s/attachment' % bug, attachment)