add fix currency
This commit is contained in:
parent
b88c0d5213
commit
c47f659657
|
|
@ -21,7 +21,7 @@ class Command(BaseCommand):
|
|||
if resp.status_code == requests.codes.ok:
|
||||
country_list = resp.json()
|
||||
if isinstance(country_list, list):
|
||||
currency_dict = country_list[0].get("currency")
|
||||
currency_dict = country_list[0].get("currencies")[0]
|
||||
if currency_dict:
|
||||
name = currency_dict.get("name")
|
||||
if name:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Currency(TranslatedFieldsMixin, models.Model):
|
|||
name = TJSONField(
|
||||
_('name'), null=True, blank=True,
|
||||
default=None, help_text='{"en-GB":"some text"}')
|
||||
sign = models.CharField(_('sign'), max_length=1)
|
||||
sign = models.CharField(_('sign'), max_length=3)
|
||||
slug = models.SlugField(max_length=255, unique=True)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user