Skip to content

Commit

Permalink
fix for cqc data
Browse files Browse the repository at this point in the history
  • Loading branch information
drkane committed Dec 16, 2024
1 parent 294c49d commit 5bd03e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion other_data/management/commands/import_cqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def parse_ods(self, link):
for ws_name in wb:
if ws_name == "README":
continue
if ws_name == "Dual_Registration_Locations":
continue
self.logger.info("Loading from sheet '{}'".format(ws_name))
ws = wb[ws_name]
headers = None
Expand Down Expand Up @@ -161,7 +163,9 @@ def parse_row(self, row):

# add IDs
this_model["CQCLocation"]["provider_id"] = this_model["CQCProvider"]["id"]
if this_model["CQCBrand"]["id"] == "-":
if not this_model["CQCBrand"].get("id"):
this_model["CQCBrand"]["id"] = None
elif this_model["CQCBrand"]["id"] == "-":
this_model["CQCBrand"]["id"] = None
if this_model["CQCBrand"].get("name", "").startswith("BRAND "):
this_model["CQCBrand"]["name"] = this_model["CQCBrand"]["name"][6:]
Expand Down

0 comments on commit 5bd03e6

Please sign in to comment.