fix currency
This commit is contained in:
parent
f47e2996f4
commit
a30f863155
|
|
@ -17,7 +17,7 @@ class Command(BaseCommand):
|
||||||
countries = Country.objects.all()
|
countries = Country.objects.all()
|
||||||
for country in countries:
|
for country in countries:
|
||||||
|
|
||||||
country_name = country.name_translated
|
country_name = country.name["en-GB"]
|
||||||
resp = requests.get(url=url.format(country=country_name))
|
resp = requests.get(url=url.format(country=country_name))
|
||||||
if resp.status_code == requests.codes.ok:
|
if resp.status_code == requests.codes.ok:
|
||||||
country_list = resp.json()
|
country_list = resp.json()
|
||||||
|
|
@ -30,8 +30,8 @@ class Command(BaseCommand):
|
||||||
currency, _ = Currency.objects.get_or_create(
|
currency, _ = Currency.objects.get_or_create(
|
||||||
slug=slug,
|
slug=slug,
|
||||||
)
|
)
|
||||||
currency.name = {"en-GB": name},
|
currency.name = {"en-GB": name}
|
||||||
currency.sign = currency_dict["symbol"],
|
currency.sign = currency_dict["symbol"]
|
||||||
currency.save()
|
currency.save()
|
||||||
establishments = Establishment.objects.filter(address__city__country=country)
|
establishments = Establishment.objects.filter(address__city__country=country)
|
||||||
establishments.update(currency=currency)
|
establishments.update(currency=currency)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user