Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/291 - JSON Schema Verification (April 2024) #813

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generated by Django 4.2.10 on 2024-03-25 16:45

from django.db import migrations
from django.db.models import Q


def set_aggregation_group_to_none_for_ie_memos(apps, schema_editor):
transaction_model = apps.get_model("transactions", "Transaction")

for transaction in transaction_model.objects.filter(
Q(transaction_type_identifier__in=[
"INDEPENDENT_EXPENDITURE_CREDIT_CARD_PAYMENT_MEMO",
"INDEPENDENT_EXPENDITURE_STAFF_REIMBURSEMENT_MEMO",
"INDEPENDENT_EXPENDITURE_PAYMENT_TO_PAYROLL_MEMO"
])
):
transaction.aggregation_group = None
transaction.save()


def reverse_removing_aggregation_group_for_ie_memos(apps, schema_editor):
transaction_model = apps.get_model("transactions", "Transaction")

for transaction in transaction_model.objects.filter(
Q(transaction_type_identifier__in=[
"INDEPENDENT_EXPENDITURE_CREDIT_CARD_PAYMENT_MEMO",
"INDEPENDENT_EXPENDITURE_STAFF_REIMBURSEMENT_MEMO",
"INDEPENDENT_EXPENDITURE_PAYMENT_TO_PAYROLL_MEMO"
])
):
transaction.aggregation_group = "INDEPENDENT_EXPENDITURE"
transaction.save()


class Migration(migrations.Migration):

dependencies = [
("transactions", "0005_schedulec_report_coverage_from_date_and_more"),
]

operations = [
migrations.RunPython(
set_aggregation_group_to_none_for_ie_memos,
reverse_removing_aggregation_group_for_ie_memos,
),
]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ django-cors-headers==3.13.0
django-storages==1.13.1
djangorestframework==3.14.0
drf-spectacular==0.24.2
git+https://github.com/fecgov/fecfile-validate@e36a2eff869a6adc97a9e812f028d0b8f18ec3a3#egg=fecfile_validate&subdirectory=fecfile_validate_python
git+https://github.com/fecgov/fecfile-validate@dd3de14672d1b3c7569d8b092ef80712b5516c01#egg=fecfile_validate&subdirectory=fecfile_validate_python
GitPython==3.1.42
gunicorn==20.1.0
invoke==1.7.3
Expand Down