Skip to content

Commit 0d96dde

Browse files
committed
Add regex that removes extra whitespaces within the lablel see HEA-968
1 parent 1527338 commit 0d96dde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pipelines/assets/livelihood_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def get_livelihood_activity_label_map(activity_type: str) -> dict[str, dict]:
328328
Return a dict of the attributes for the Livelihood Activities, stored in the ActivityLabel Django model.
329329
"""
330330
label_map = {
331-
instance["activity_label"].lower(): instance
331+
re.sub(r"\s+", " ", instance["activity_label"].strip().lower()): instance
332332
for instance in ActivityLabel.objects.filter(
333333
status=ActivityLabel.LabelStatus.OVERRIDE, activity_type=activity_type
334334
).values(

0 commit comments

Comments
 (0)