Skip to content

Commit 135302c

Browse files
committed
fix(spp_area_hdx): replace magic number with len() for prefix slice
1 parent 2d149ab commit 135302c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spp_area_hdx/models/hdx_cod_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _compute_country_iso3(self):
5050
"""
5151
for record in self:
5252
if record.hdx_dataset_id and record.hdx_dataset_id.startswith("cod-ab-"):
53-
record.country_iso3 = record.hdx_dataset_id[7:].upper()
53+
record.country_iso3 = record.hdx_dataset_id[len("cod-ab-"):].upper()
5454
elif record.country_id:
5555
record.country_iso3 = record.country_id.code
5656
else:

0 commit comments

Comments
 (0)