Fixes: AddressManager
This commit is contained in:
parent
705bb79903
commit
e716f88eac
1 changed files with 3 additions and 4 deletions
|
|
@ -61,7 +61,7 @@ class AddressManager(models.Manager):
|
||||||
address_line_2 = ""
|
address_line_2 = ""
|
||||||
|
|
||||||
# Create the model instance, storing both the input string and full API response
|
# Create the model instance, storing both the input string and full API response
|
||||||
return super().create(
|
return super().get_or_create(
|
||||||
raw_data=raw_data,
|
raw_data=raw_data,
|
||||||
address_line=f"{address_line_1}, {address_line_2}",
|
address_line=f"{address_line_1}, {address_line_2}",
|
||||||
street=street,
|
street=street,
|
||||||
|
|
@ -70,7 +70,6 @@ class AddressManager(models.Manager):
|
||||||
region=region,
|
region=region,
|
||||||
postal_code=postal_code,
|
postal_code=postal_code,
|
||||||
country=country,
|
country=country,
|
||||||
location=location,
|
defaults={"api_response": data, "location": location},
|
||||||
api_response=data,
|
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)[0]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue