diff --git a/.gitignore b/.gitignore index d25063b..40497c7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # Edit at https://www.gitignore.io/?templates=linux,macos,python,django,windows,pycharm,intellij,visualstudio ### Django ### +*.env *.log *.pot *.pyc diff --git a/back/.env b/back/.env index b47f7a4..c75a73f 100644 --- a/back/.env +++ b/back/.env @@ -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=admin@reimbursinator.com diff --git a/back/backend/migrations/0009_section_approved.py b/back/backend/migrations/0009_section_approved.py new file mode 100644 index 0000000..2621ee0 --- /dev/null +++ b/back/backend/migrations/0009_section_approved.py @@ -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), + ), + ] diff --git a/back/backend/models.py b/back/backend/models.py index 69db8ee..cc12b3a 100644 --- a/back/backend/models.py +++ b/back/backend/models.py @@ -33,6 +33,7 @@ class Section(models.Model): title = models.CharField(max_length=256) html_description = models.TextField() number = models.IntegerField() + approved = models.BooleanField(default=False) def __str__(self): """ diff --git a/back/backend/templates/backend/email.html b/back/backend/templates/backend/email.html index b985302..7137071 100644 --- a/back/backend/templates/backend/email.html +++ b/back/backend/templates/backend/email.html @@ -6,7 +6,7 @@

Title: {{ title }}

{% for section in sections %} {% if section.completed %} -

{{section.title}}

+

{{section.title}} (SID: {{section.id}})

{% for field in section.fields %} diff --git a/back/backend/templates/backend/email.txt b/back/backend/templates/backend/email.txt index 43f9df7..2411e0e 100644 --- a/back/backend/templates/backend/email.txt +++ b/back/backend/templates/backend/email.txt @@ -5,7 +5,7 @@ Title: {{title}} {% for section in sections %} - {{section.title}} + {{section.title}}(SID: {{section.id}}) {% for field in section.fields %} {{field.label}}: {{field.value|default:"empty"}} {% endfor %} diff --git a/back/backend/views.py b/back/backend/views.py index 1d55aec..a99d999 100644 --- a/back/backend/views.py +++ b/back/backend/views.py @@ -51,7 +51,7 @@ def get_sections(r_id): # append the fields for corresponding section data.update(get_fields(i.id)) # 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 for rule in rules: try: @@ -338,7 +338,7 @@ def section(request, report_pk, section_pk): } data.update(get_fields(s.id)) # 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 for rule in rules: try: diff --git a/back/db.sqlite3 b/back/db.sqlite3 index e1d4159..d5c6c8b 100644 Binary files a/back/db.sqlite3 and b/back/db.sqlite3 differ