get_link_map() should not have None keys

This commit is contained in:
Kovid Goyal 2024-10-21 13:38:54 +05:30
parent 4e8006a0da
commit 235ea54a5c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2533,7 +2533,9 @@ class Cache:
raise ValueError(f"Lookup name {for_field} doesn't have a link map") raise ValueError(f"Lookup name {for_field} doesn't have a link map")
lm = table.link_map lm = table.link_map
vm = table.id_map vm = table.id_map
return {vm.get(fid):v for fid,v in lm.items() if v} ans = {vm.get(fid):v for fid,v in lm.items() if v}
ans.pop(None)
return ans
@read_api @read_api
def link_for(self, field, item_id): def link_for(self, field, item_id):