Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maxmind/minfraud-api-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6bd16e61c29530198f15e6c78236c4c7a0741802
Choose a base ref
..
head repository: maxmind/minfraud-api-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 431c61625a6861370a38dbf2777a3e88045410f9
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 minfraud/models.py
10 changes: 5 additions & 5 deletions minfraud/models.py
Original file line number Diff line number Diff line change
@@ -21,21 +21,21 @@ def to_dict(self):
for key, value in self.__dict__.items():
if hasattr(value, "to_dict") and callable(value.to_dict):
if d := value.to_dict():
result[key] = d
result[key] = d
elif hasattr(value, "raw"):
# geoip2 uses "raw" for historical reasons
if d := value.raw:
result[key] = d
result[key] = d
elif isinstance(value, list):
ls = []
for e in value:
if hasattr(e, "to_dict") and callable(e.to_dict):
if e := e.to_dict():
ls.append(e)
ls.append(e)
elif e is not None:
ls.append(e)
ls.append(e)
if ls:
result[key] = ls
result[key] = ls
elif value is not None:
result[key] = value
return result