Skip to content

Commit

Permalink
fixes loading of lsg and ward data; fixes #2667
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Dec 20, 2024
1 parent 88a9cb4 commit 462b70b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion care/users/management/commands/load_lsg_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def create_local_bodies(local_body_list):
# Hence, those records can be ignored using the `ignore_conflicts` flag
LocalBody.objects.bulk_create(local_body_objs, ignore_conflicts=True)

for counter, f in enumerate(sorted(Path.glob(f"{folder}/*.json"))):
for counter, f in enumerate(sorted(Path(folder).glob("*.json"))):
with Path(f).open() as data_f:
data = json.load(data_f)
data.pop("wards", None)
Expand Down
2 changes: 1 addition & 1 deletion care/users/management/commands/load_ward_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_local_body(lb):
),
).first()

for f in sorted(Path.glob(f"{folder}/*.json")):
for f in sorted(Path(folder).glob("*.json")):
with Path(f).open() as data_f:
data = json.load(data_f)
wards = data.pop("wards", None)
Expand Down

0 comments on commit 462b70b

Please sign in to comment.