Skip to content

[DEV-14526] - Fix Agency Code in Download File Name#4612

Open
zachflanders-frb wants to merge 1 commit intoqatfrom
fix/dev-14526-account-download-agency-name
Open

[DEV-14526] - Fix Agency Code in Download File Name#4612
zachflanders-frb wants to merge 1 commit intoqatfrom
fix/dev-14526-account-download-agency-name

Conversation

@zachflanders-frb
Copy link
Contributor

Description:

The agency code was getting set to 'All' in the download name regardless of whether it was set in the request. This was due to a small bug in how the agency key was accessed on the request filters.

  1. Unit & integration tests updated
  2. Jira Ticket(s)
    1. DEV-0

Explain N/A in above checklist:

)

assert resp.status_code == status.HTTP_200_OK
assert "FY2017Q1-Q4_100_FA_AccountBalances" in resp.json()["file_name"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to the test to ensure the name is correct and includes the agency code "100"

def create_unique_filename(json_request: dict[str, Any], origination: str | None = None) -> str:
timestamp = datetime.strftime(datetime.now(timezone.utc), "%Y-%m-%d_H%HM%MS%S%f")
request_agency = json_request.get("agency", "all")
request_agency = json_request.get("filters", {}).get("agency", "all")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needed to update the access path to include "filters". The "agency" property is on "filters" instead of the parent level of the json_request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant