-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from fecgov/release/sprint-9
Release/sprint 9
- Loading branch information
Showing
12 changed files
with
383 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
cd django-backend | ||
|
||
# Run migrations | ||
./manage.py migrate --noinput | ||
./manage.py migrate --noinput > migrate.out | ||
|
||
# Run application | ||
python wait_for_db.py && gunicorn --bind 0.0.0.0:8080 fecfiler.wsgi -w 9 -t 200 |
202 changes: 202 additions & 0 deletions
202
django-backend/fecfiler/f3x_summaries/fixtures/report_code_labels.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
[ | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 1, | ||
"fields": { | ||
"label": "APRIL 15 (Q1)", | ||
"report_code": "Q1" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 2, | ||
"fields": { | ||
"label": "JULY 15 (Q2)", | ||
"report_code": "Q2" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 3, | ||
"fields": { | ||
"label": "OCTOBER 15 (Q3)", | ||
"report_code": "Q3" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 4, | ||
"fields": { | ||
"label": "JANUARY 31 (YE)", | ||
"report_code": "YE" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 5, | ||
"fields": { | ||
"label": "TERMINATION (TER)", | ||
"report_code": "TER" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 6, | ||
"fields": { | ||
"label": "JANUARY 31 (31)", | ||
"report_code": "MY" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 7, | ||
"fields": { | ||
"label": "GENERAL (12G)", | ||
"report_code": "12G" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 8, | ||
"fields": { | ||
"label": "PRIMARY (12P)", | ||
"report_code": "12P" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 9, | ||
"fields": { | ||
"label": "RUNOFF (12R)", | ||
"report_code": "12R" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 10, | ||
"fields": { | ||
"label": "SPECIAL (12S)", | ||
"report_code": "12S" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 11, | ||
"fields": { | ||
"label": "CONVENTION (12C)", | ||
"report_code": "12C" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 12, | ||
"fields": { | ||
"label": "GENERAL (30G)", | ||
"report_code": "30G" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 13, | ||
"fields": { | ||
"label": "RUNOFF (30R)", | ||
"report_code": "30R" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 14, | ||
"fields": { | ||
"label": "SPECIAL (30S)", | ||
"report_code": "30S" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 15, | ||
"fields": { | ||
"label": "FEBRUARY 20 (M2)", | ||
"report_code": "M2" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 16, | ||
"fields": { | ||
"label": "MARCH 30 (M3)", | ||
"report_code": "M3" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 17, | ||
"fields": { | ||
"label": "APRIL 20 (M4)", | ||
"report_code": "M4" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 18, | ||
"fields": { | ||
"label": "MAY 20 (M5)", | ||
"report_code": "M5" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 19, | ||
"fields": { | ||
"label": "JUNE 20 (M6)", | ||
"report_code": "M6" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 20, | ||
"fields": { | ||
"label": "JULY 20 (M7)", | ||
"report_code": "M7" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 21, | ||
"fields": { | ||
"label": "AUGUST 20 (M8)", | ||
"report_code": "M8" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 22, | ||
"fields": { | ||
"label": "SEPTEMBER 20 (M9)", | ||
"report_code": "M9" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 23, | ||
"fields": { | ||
"label": "OCTOBER 20 (M10)", | ||
"report_code": "M10" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 24, | ||
"fields": { | ||
"label": "NOVEMBER 20 (M11)", | ||
"report_code": "M11" | ||
} | ||
}, | ||
{ | ||
"model": "f3x_summaries.reportcodelabel", | ||
"pk": 25, | ||
"fields": { | ||
"label": "DECEMBER 20 (M12)", | ||
"report_code": "M12" | ||
} | ||
} | ||
] |
23 changes: 18 additions & 5 deletions
23
django-backend/fecfiler/f3x_summaries/migrations/0009_auto_20220515_2116.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
# Generated by Django 3.2.12 on 2022-05-16 01:16 | ||
|
||
from fecfiler.f3x_summaries.models import F3XSummary | ||
from django.db import migrations, models | ||
|
||
|
||
def convert_fecfile_booleans(apps, schema_editor): | ||
for f3x_summary in F3XSummary.objects.all(): | ||
f3x_summary.change_of_address = ( | ||
True if f3x_summary.change_of_address in ["true", "X"] else False | ||
) | ||
f3x_summary.qualified_committee = ( | ||
True if f3x_summary.qualified_committee in ["true", "X"] else False | ||
) | ||
f3x_summary.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('f3x_summaries', '0008_auto_20220503_1411'), | ||
("f3x_summaries", "0008_auto_20220503_1411"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(convert_fecfile_booleans), | ||
migrations.AlterField( | ||
model_name='f3xsummary', | ||
name='change_of_address', | ||
model_name="f3xsummary", | ||
name="change_of_address", | ||
field=models.BooleanField(blank=True, default=False, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='f3xsummary', | ||
name='qualified_committee', | ||
model_name="f3xsummary", | ||
name="qualified_committee", | ||
field=models.BooleanField(blank=True, default=False, null=True), | ||
), | ||
] |
60 changes: 60 additions & 0 deletions
60
django-backend/fecfiler/f3x_summaries/migrations/0010_auto_20220525_1157.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Generated by Django 3.2.12 on 2022-05-25 15:57 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
from django.core.management import call_command | ||
|
||
|
||
def forwards_func(apps, schema_editor): | ||
call_command( | ||
"loaddata", | ||
"fecfiler/f3x_summaries/fixtures/report_code_labels.json", | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("f3x_summaries", "0009_auto_20220515_2116"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ReportCodeLabel", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("label", models.TextField(blank=True, null=True)), | ||
("report_code", models.TextField(blank=True, null=True, unique=True)), | ||
], | ||
options={ | ||
"db_table": "report_code_labels", | ||
}, | ||
), | ||
migrations.AddIndex( | ||
model_name="reportcodelabel", | ||
index=models.Index( | ||
fields=["report_code"], name="report_code_report__9cd13b_idx" | ||
), | ||
), | ||
migrations.RunPython(forwards_func), | ||
migrations.AlterField( | ||
model_name="f3xsummary", | ||
name="report_code", | ||
field=models.ForeignKey( | ||
blank=True, | ||
db_column="report_code", | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="f3x_summaries.reportcodelabel", | ||
to_field="report_code", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.