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 = ""
|
||||
|
||||
# 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,
|
||||
address_line=f"{address_line_1}, {address_line_2}",
|
||||
street=street,
|
||||
|
|
@ -70,7 +70,6 @@ class AddressManager(models.Manager):
|
|||
region=region,
|
||||
postal_code=postal_code,
|
||||
country=country,
|
||||
location=location,
|
||||
api_response=data,
|
||||
defaults={"api_response": data, "location": location},
|
||||
**kwargs,
|
||||
)
|
||||
)[0]
|
||||
|
|
|
|||
Loading…
Reference in a new issue