Set postage on basis of postage argument or template postage

This commit is contained in:
Pea Tyczynska
2019-02-05 12:48:40 +00:00
parent f6d3e87de5
commit 5b9e6c2086
9 changed files with 63 additions and 69 deletions

View File

@@ -42,6 +42,7 @@ from app.models import (
User,
EMAIL_TYPE,
SMS_TYPE,
LETTER_TYPE,
KEY_TYPE_NORMAL,
AnnualBilling,
InvitedOrganisationUser,
@@ -159,9 +160,10 @@ def create_template(
'created_by': service.created_by,
'reply_to': reply_to,
'hidden': hidden,
'folder': folder,
'postage': postage,
'folder': folder
}
if template_type == LETTER_TYPE:
data["postage"] = postage or "second"
if template_type != SMS_TYPE:
data['subject'] = subject
template = Template(**data)