Added 'approved' field to sections. Added env to gitignore.

This commit is contained in:
kououken 2019-03-01 11:38:12 -08:00
parent 9658afda32
commit b1b21c84c7
8 changed files with 28 additions and 8 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
# Edit at https://www.gitignore.io/?templates=linux,macos,python,django,windows,pycharm,intellij,visualstudio # Edit at https://www.gitignore.io/?templates=linux,macos,python,django,windows,pycharm,intellij,visualstudio
### Django ### ### Django ###
*.env
*.log *.log
*.pot *.pot
*.pyc *.pyc

View file

@ -1,4 +1,4 @@
EMAIL_HOST_USER=accountemail@yourmail.com EMAIL_HOST_USER=reimbursinator@gmail.com
EMAIL_HOST_PASSWORD=accountpasswordhere EMAIL_HOST_PASSWORD=Frank12345
SUBMIT_REPORT_DESTINATION_EMAIL=to-address@yourmail.com SUBMIT_REPORT_DESTINATION_EMAIL=kououken@gmail.com
SUBMIT_REPORT_FROM_EMAIL=from-address@yourmail.com SUBMIT_REPORT_FROM_EMAIL=admin@reimbursinator.com

View file

@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-03-01 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0008_auto_20190214_1421'),
]
operations = [
migrations.AddField(
model_name='section',
name='approved',
field=models.BooleanField(default=False),
),
]

View file

@ -33,6 +33,7 @@ class Section(models.Model):
title = models.CharField(max_length=256) title = models.CharField(max_length=256)
html_description = models.TextField() html_description = models.TextField()
number = models.IntegerField() number = models.IntegerField()
approved = models.BooleanField(default=False)
def __str__(self): def __str__(self):
""" """

View file

@ -6,7 +6,7 @@
<h1>Title: {{ title }}</h1> <h1>Title: {{ title }}</h1>
{% for section in sections %} {% for section in sections %}
{% if section.completed %} {% if section.completed %}
<h2>{{section.title}}</h2> <h2>{{section.title}} (SID: {{section.id}})</h2>
<table border="1"> <table border="1">
{% for field in section.fields %} {% for field in section.fields %}
<tr> <tr>

View file

@ -5,7 +5,7 @@
Title: {{title}} Title: {{title}}
{% for section in sections %} {% for section in sections %}
{{section.title}} {{section.title}}(SID: {{section.id}})
{% for field in section.fields %} {% for field in section.fields %}
{{field.label}}: {{field.value|default:"empty"}} {{field.label}}: {{field.value|default:"empty"}}
{% endfor %} {% endfor %}

View file

@ -51,7 +51,7 @@ def get_sections(r_id):
# append the fields for corresponding section # append the fields for corresponding section
data.update(get_fields(i.id)) data.update(get_fields(i.id))
# process rules from the policy file if the section is completed # process rules from the policy file if the section is completed
if i.completed: if i.completed and not i.approved:
rules = pol.sections[index].rules rules = pol.sections[index].rules
for rule in rules: for rule in rules:
try: try:
@ -338,7 +338,7 @@ def section(request, report_pk, section_pk):
} }
data.update(get_fields(s.id)) data.update(get_fields(s.id))
# process rules from the policy file if the section is completed # process rules from the policy file if the section is completed
if s.completed: if s.completed and not s.approved:
rules = pol.sections[s.number].rules rules = pol.sections[s.number].rules
for rule in rules: for rule in rules:
try: try:

Binary file not shown.