From b1b21c84c73d296f5a16cabcf6d795f7dad10165 Mon Sep 17 00:00:00 2001 From: kououken Date: Fri, 1 Mar 2019 11:38:12 -0800 Subject: [PATCH] Added 'approved' field to sections. Added env to gitignore. --- .gitignore | 1 + back/.env | 8 ++++---- .../migrations/0009_section_approved.py | 18 ++++++++++++++++++ back/backend/models.py | 1 + back/backend/templates/backend/email.html | 2 +- back/backend/templates/backend/email.txt | 2 +- back/backend/views.py | 4 ++-- back/db.sqlite3 | Bin 197632 -> 197632 bytes 8 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 back/backend/migrations/0009_section_approved.py 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 e1d41596d7922b7a3494ee4a62a36f8929456c47..d5c6c8b12e49f18828982266bd3b34288ffb3c7d 100644 GIT binary patch delta 3313 zcmeH}i*FRi8Nm0O?;g8;Kd=pco*(#iXM6ALJHNoj*oG>p?V6AVBg1h%ukqn~`R)v{ zNkt4~h0>y69qOQz)PNd7DUi|wyAn!yv_)!BBupAL2-1X9EhS1D+!88jS&ri_vUZHM^{kzoFjd3s=}qVLSd1k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