Merge pull request #124 from danieldupriest/template-boolean-fix
Fixes three bugs relating to email and report formatting
This commit is contained in:
commit
f8d08ae7fd
4 changed files with 9 additions and 9 deletions
|
@ -1,4 +0,0 @@
|
|||
EMAIL_HOST_USER=accountemail@yourmail.com
|
||||
EMAIL_HOST_PASSWORD=accountpasswordhere
|
||||
SUBMIT_REPORT_DESTINATION_EMAIL=to-address@yourmail.com
|
||||
SUBMIT_REPORT_FROM_EMAIL=from-address@yourmail.com
|
|
@ -12,7 +12,11 @@
|
|||
{% for field in section.fields %}
|
||||
<tr>
|
||||
<td>{{field.label}}</td>
|
||||
<td>{{field.value|default:""}}</td>
|
||||
<td>{% if field.field_type == 'boolean' %}
|
||||
{{field.value|yesno:"yes,no"}}
|
||||
{% else %}
|
||||
{{field.value|default:" "}}
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for rule in section.rule_violations %}
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
Title: {{title}}
|
||||
Reference #: {{reference_number}}
|
||||
{% for section in sections %}
|
||||
{% for section in sections %}{% if section.completed %}
|
||||
{{section.title}}(SID: {{section.id}})
|
||||
{% for field in section.fields %}
|
||||
{{field.label}}: {{field.value|default:"empty"}}
|
||||
{{field.label}}: {% if field.field_type == 'boolean' %}{{field.value|yesno:"yes,no"}}{% else %}{{field.value|default:" "}}{% endif %}
|
||||
{% endfor %}
|
||||
{% for rule in section.rule_violations %}
|
||||
[RULE] {{rule.label}}: {{rule.rule_break_text}}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}{% endfor %}
|
||||
|
|
|
@ -414,7 +414,7 @@ def send_report_to_admin(request, report_pk, status):
|
|||
message = None
|
||||
if params['reference_number'] == '':
|
||||
message = EmailMultiAlternatives(
|
||||
"[Reimbursinator {}] ({})".format(params['title'], status),
|
||||
"[Reimbursinator] {} ({})".format(params['title'], status),
|
||||
msg_plain,
|
||||
from_email,
|
||||
[to_email],
|
||||
|
|
Loading…
Reference in a new issue