summaryrefslogtreecommitdiff
path: root/service/pixelated/user_agent.py
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-09-29 18:00:52 -0300
committerDuda Dornelles <ddornell@thoughtworks.com>2014-09-29 18:00:52 -0300
commit7fa4661018272edaf11109efdb9ff834d365f3ab (patch)
tree158f090a915d99c6314b412035a42c1d810f6d29 /service/pixelated/user_agent.py
parent99d540becb364a46553e0b3e8a6a8933947bd699 (diff)
Testing drafts in integration, fixing a bug where the sent wasnt leaving the drafts mailbox
Diffstat (limited to 'service/pixelated/user_agent.py')
-rw-r--r--service/pixelated/user_agent.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/service/pixelated/user_agent.py b/service/pixelated/user_agent.py
index 8651a822..2dc71bf0 100644
--- a/service/pixelated/user_agent.py
+++ b/service/pixelated/user_agent.py
@@ -60,14 +60,11 @@ def disabled_features():
@app.route('/mails', methods=['POST'])
def send_mail():
_mail = InputMail.from_dict(request.json)
- if 'saveDraft' in DISABLED_FEATURES:
- mail_service.send(_mail)
+ draft_id = request.json.get('ident')
+ if draft_id:
+ mail_service.send(draft_id, _mail)
else:
- draft_id = request.json.get('ident')
- if draft_id:
- mail_service.send(draft_id, _mail)
- else:
- _mail = mail_service.create_draft(_mail)
+ _mail = mail_service.create_draft(_mail)
return respond_json(_mail.as_dict())