Skip to content

RealEstateUnit address not set on user creation #1007

@BradHN1

Description

@BradHN1

Describe the bug
RealEstateUnit has an address field, which is a foreign key link to a Location.
It also has a redundant "Location" json field which was the original version, perhaps this should have been eliminated.

The code was updated a couple years ago to use the address field to determine which households (RealEstateUnit) were in which zip code, so actions, households and carbon could be properly attributed.

Unfortunately users.create was not updating the address field so new households mostly do not have it.

Two parts to this ticket:

  1. make users.create create the household with the address field properly filled in
  2. backfill the existing RealEstate units to fill in the address from the location field. For this there was a task in misc.py called backfill_real_estate_units; moving this to a Task so it can be invoked from the admin portal like other tasks.

Metadata

Metadata

Assignees

Labels

APIAPIbugSomething isn't working

Type

No type

Projects

Status

Local Testing (Verification)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions