fix currency

This commit is contained in:
Dmitriy Kuzmenko 2019-11-03 17:39:10 +03:00
parent f47e2996f4
commit a30f863155

View File

@ -17,7 +17,7 @@ class Command(BaseCommand):
countries = Country.objects.all()
for country in countries:
country_name = country.name_translated
country_name = country.name["en-GB"]
resp = requests.get(url=url.format(country=country_name))
if resp.status_code == requests.codes.ok:
country_list = resp.json()
@ -30,8 +30,8 @@ class Command(BaseCommand):
currency, _ = Currency.objects.get_or_create(
slug=slug,
)
currency.name = {"en-GB": name},
currency.sign = currency_dict["symbol"],
currency.name = {"en-GB": name}
currency.sign = currency_dict["symbol"]
currency.save()
establishments = Establishment.objects.filter(address__city__country=country)
establishments.update(currency=currency)