Skip to content

Commit 3acec84

Browse files
author
Paul Philion
committed
fixing attachment upload bug in the imap threader
1 parent c56a433 commit 3acec84

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

redmine/model.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ def __init__(self, name:str, content_type:str, payload):
2525
self.payload = payload
2626
self.token = None
2727

28-
def upload(self, client, user):
29-
# FIXME This is messy, move to caller.
30-
self.token = client.ticket_mgr.upload_file(user, self.payload, self.name, self.content_type)
31-
3228
def set_token(self, token):
3329
self.token = token
3430

threader/imap.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ def handle_message(self, msg_id:str, message:Message):
204204
log.info(f"Unknow user: {addr}, created new account.")
205205

206206
# upload any attachments
207-
for attachment in message.attachments:
208-
# uploading the attachment this way
209-
# puts the token in the attachment
210-
attachment.upload(self.redmine, user.login)
207+
self.ticket_mgr.upload_attachment(user, message.attachments)
211208

212209
if ticket:
213210
# found a ticket, append the message

0 commit comments

Comments
 (0)