Fixed booleans to appear as yes/no in emailed report

This commit is contained in:
kououken 2019-03-08 12:43:47 -08:00
parent 901102a304
commit 7d83a8ccaa
3 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,4 @@
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
EMAIL_HOST_USER=reimbursinator@gmail.com
EMAIL_HOST_PASSWORD=Frank12345
SUBMIT_REPORT_DESTINATION_EMAIL=kououken@gmail.com
SUBMIT_REPORT_FROM_EMAIL=from-address@yourmail.com

View file

@ -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 %}

View file

@ -8,7 +8,7 @@ Reference #: {{reference_number}}
{% for section in sections %}
{{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}}