Skip to content

Address is None on latest_311_intent #313

@dphiggs01

Description

@dphiggs01

Describe the bug
While playing with the service I noticed that the Address is not always returned on the 311 Intent.
Below is an example of a returned 311 Intent Card. You can see that the second Address is None.

Here are the 3 latest three one one reports: There was a request at 107 Needham Rd for the Animal Control to address Animal Lost. There was a request at None for the Mayor's 24 Hour Hotline to address General Comments For An Employee. There was a request at 195 Brunswick St for the Inspectional Services to address Building Inspection Request.

A simple fix to this would be to add conditionals on the build_speech_from_311_report method
line 108 of latest_311_intent.py

subject = report["subject"] if report["subject"] else '311 support'
report_type = report["type"] if report["type"] else 'Unknown issue'
location = report["location_street_name"] if report["location_street_name"] else 'Unknown Street'

Also adding an extra \n\n after each issue on the return card will make it look a little prettier.

Here are the 3 latest three one one reports:

There was a request at 107 Needham Rd for the Animal Control to address Animal Lost.

There was a request at None for the Mayor's 24 Hour Hotline to address General Comments For An Employee.

There was a request at 195 Brunswick St for the Inspectional Services to address Building Inspection Request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions