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

Include detailed landlord information from NYCDB in HP Action packet #401

Merged
merged 5 commits into from
Nov 30, 2018

Conversation

toolness
Copy link
Collaborator

This fixes #394.

A note on corporate landlords

I think I made a slight mistake in #380, in that for corporate landlords, I took the "name" value from the company owner field. However, based on the way @romeboards filled out the HP Action form on the LHI website, I think we actually need to take the name from the head officer field (we've been using the address from the head officer field, but not the name).

I think this is because company names are so often hidden behind a shell company that they're rendered fairly useless.

That said, the LHI interactive form makes it seem like you are supposed to put the company name in the "name of landlord" field, because once you select the "company" radio button, the "first name" and "last name" fields (which are shown for individual landlords) disappear and are replaced by a single "name of landlord" field. It seems like the creators of the LHI form were themselves confused, because this snippet shows up in the Master.cmp:

IF Landlord entity or individual MC = "Individual"
    SHOW Landlord name first TE
    SHOW Landlord name last TE
ELSE
    SHOW Landlord entity name TE
    //	SHOW Landlord contact person name first TE
    //	SHOW Landlord contact person name last TE
END IF

Notice the commented-out lines; it seems like at some point, they were asking for a contact person's first and last name in the case of corporate landlords, but reverted to just asking for an "entity name".

This is so confusing.

Caching a user's BBL

We're finally moving to just caching a user's BBL, like we already cache their ZIP code, rather than constantly re-fetching it from the geocoding service whenever we need it. However, this is going to require populating the cached field once we make the database migration that's included in this PR. Here's some code to do that:

import os

if __name__ == '__main__':
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')

    import django
    django.setup()

    from onboarding.models import OnboardingInfo

    for info in OnboardingInfo.objects.filter(pad_bbl=''):
        print(f"Updating address metadata for {info.user}.")
        info.save()

# This is kind of yucky, because NYCDB/HPD provides state information as
# all-caps two-letter strings (e.g. "NY") while the HotDocs endpoint wants
# them fully spelled out (e.g. "New York"). However, in practice it doesn't seem
# to mind if we give it the two-letter strings, so we'll just do that.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Um, I say "in practice it doesn't seem to mind" but I haven't actually verified this, I'm just guessing it's the case. I should verify it before merging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, I just verified it... um... it actually seems like the more granular address info might not be used at all, i.e. LHI is just asking for it so it knows that the full address it pastes together is valid, and it doesn't need to do that with our answers because we paste stuff together on our end. I might be wrong though.


# TODO: We might actually want to fill this out even if we don't find
# a management company, as this could at least generate the required
# forms. Need to find this out.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@romeboards I'm curious what you think of this TODO. Do we still want to fill out the fields asking if the management company should be sued, even if we don't find a management company for the user, so that hopefully the forms are in the packet just in case they decide to go that route? Or alternatively, if the user has an individual owner landlord (not a company) does that mean there won't be a management company involved?

def user_to_hpactionvars(user: JustfixUser) -> hp.HPActionVariables:
v = hp.HPActionVariables()

# TODO: The HP Action form actually has a field for home phone
# and a separate one for work; it's unclear which one the
# user may have provided, but we'll assume it's home for now.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@romeboards also curious what you think of this. Since you filled out "home phone" on LHI's site, I'm guessing it's the one we want to fill out for the user.

@@ -192,6 +192,7 @@ def user_to_hpactionvars(user: JustfixUser) -> hp.HPActionVariables:
]
v.sue_for_repairs_tf = True
v.request_fee_waiver_tf = True
v.sue_for_harassment_tf = False
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Heh, the PDF wasn't showing the address of the management company at all until I explicitly added this line. So finicky.

@toolness toolness merged commit 9ee572b into master Nov 30, 2018
@toolness toolness deleted the hp-action-landlord-details branch November 30, 2018 09:23
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.

Include detailed landlord information from NYCDB in HP Action packet
1 participant