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

[Bug] van.apply_response raises unnecessary error #1142

Open
lkesich opened this issue Sep 27, 2024 · 2 comments
Open

[Bug] van.apply_response raises unnecessary error #1142

lkesich opened this issue Sep 27, 2024 · 2 comments
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed

Comments

@lkesich
Copy link

lkesich commented Sep 27, 2024

Detailed Description

The apply_response method from the VAN() class raises an error if the contact type is Phone, SMS etc and the phone number is missing. VAN made a change and no longer has phone number as a required field for bulk uploads with these contact types. Would you please remove this exception if it no longer applies?

From the source:

        if (
            contact_type_id == 1  # Phone
            or contact_type_id == 19  # Auto Dial
            or contact_type_id == 37  # SMS Text
            or contact_type_id == 67  # Phone Bank
            or contact_type_id == 68  # Consumer Phone
            or contact_type_id == 72  # Leader Phone
            or contact_type_id == 112  # Personal Phone
            or contact_type_id == 132  # Relational Text
            or contact_type_id == 143  # Distributed Text
            or contact_type_id == 147  # Bulk Text
            or contact_type_id == 149  # Paid SMS
        ):
            if not phone:
                raise Exception("A phone number must be provided if canvassed via phone or SMS")

Your Environment

  • Version of Parsons used (if you know): 3.1.0

Priority

High

@lkesich lkesich added the bug Impact - something is currently broken in Parsons and needs to be fixed label Sep 27, 2024
@matthewkrausse
Copy link
Contributor

I'll fix this.

@lkesich
Copy link
Author

lkesich commented Oct 7, 2024

@matthewkrausse I'm sorry, I noticed that this method is also used to apply canvass results from unsuccessful canvass attempts, and VAN does still require a phone number in that situation. It doesn't requires a phone number if you're applying survey responses/activist codes with a phone contact type. Sorry about that--I was having tunnel vision for my particular use case. I do still think the error should only be raised if response is None or if resultid is not None or with some other way of differentiating between successful and unsuccessful attempts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants