Skip to content

Commit

Permalink
Merge pull request #3080 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Dec 23, 2023
2 parents a4774af + a660153 commit a26fdc3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Binary file not shown.
7 changes: 3 additions & 4 deletions backend/audit/intakelib/checks/check_cluster_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
from django.conf import settings
from audit.intakelib.intermediate_representation import get_range_by_name
from audit.intakelib.common import get_message, build_cell_error_tuple
from .check_cluster_total import NOT_APPLICABLE, OTHER_CLUSTER, STATE_CLUSTER

logger = logging.getLogger(__name__)

STATE_CLUSTER = "STATE CLUSTER"
OTHER_CLUSTER = "OTHER CLUSTER NOT LISTED ABOVE"


def check_cluster_names(ir):
"""Check that cluster names are valid when present."""
Expand All @@ -29,7 +27,8 @@ def check_cluster_names(ir):

for index, value in enumerate(range_data["values"]):
if value and value not in (
valid_json["cluster_names"] + [STATE_CLUSTER, OTHER_CLUSTER]
valid_json["cluster_names"]
+ [STATE_CLUSTER, OTHER_CLUSTER, NOT_APPLICABLE]
):
errors.append(
build_cell_error_tuple(
Expand Down
1 change: 1 addition & 0 deletions backend/audit/intakelib/checks/check_cluster_total.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

logger = logging.getLogger(__name__)

# A copy of theses constants exists in schema/source/base/Base.libsonnet
STATE_CLUSTER = "STATE CLUSTER"
OTHER_CLUSTER = "OTHER CLUSTER NOT LISTED ABOVE"
NOT_APPLICABLE = "N/A"
Expand Down
3 changes: 1 addition & 2 deletions backend/audit/intakelib/checks/check_other_cluster_names.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import logging
from audit.intakelib.intermediate_representation import get_range_by_name
from audit.intakelib.common import get_message, build_cell_error_tuple
from .check_cluster_total import OTHER_CLUSTER

logger = logging.getLogger(__name__)

OTHER_CLUSTER = "OTHER CLUSTER NOT LISTED ABOVE"


def other_cluster_names(ir):
cluster_name = get_range_by_name(ir, "cluster_name")
Expand Down
3 changes: 1 addition & 2 deletions backend/audit/intakelib/checks/check_state_cluster_names.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import logging
from audit.intakelib.intermediate_representation import get_range_by_name
from audit.intakelib.common import get_message, build_cell_error_tuple
from .check_cluster_total import STATE_CLUSTER

logger = logging.getLogger(__name__)

STATE_CLUSTER = "STATE CLUSTER"


def state_cluster_names(ir):
cluster_name = get_range_by_name(ir, "cluster_name")
Expand Down
1 change: 1 addition & 0 deletions backend/dissemination/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def get(self, request, *args, **kwargs):
{
"form": form,
"state_abbrevs": STATE_ABBREVS,
"summary_report_download_limit": SUMMARY_REPORT_DOWNLOAD_LIMIT,
},
)

Expand Down

0 comments on commit a26fdc3

Please sign in to comment.