fix: use max function to get default company address

This commit is contained in:
Prateek 2023-02-17 20:25:13 +05:30
parent 6b3028d77b
commit b93c18bd4a

View File

@ -808,7 +808,7 @@ def get_default_company_address(name, sort_key="is_primary_address", existing_ad
return existing_address
if out:
return min(out, key=lambda x: x[1])[0] # find min by sort_key
return max(out, key=lambda x: x[1])[0] # find max by sort_key
else:
return None