mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
chomp out non-ascii characters from enum name generation
This commit is contained in:
parent
c4febcde04
commit
3d99b9c05f
|
@ -29,7 +29,8 @@ singledispatch = import_single_dispatch()
|
|||
|
||||
|
||||
def convert_choice_name(name):
|
||||
name = to_const(force_text(name))
|
||||
name = force_text(name).encode('utf8').decode('ascii', 'ignore')
|
||||
name = to_const(name)
|
||||
try:
|
||||
assert_valid_name(name)
|
||||
except AssertionError:
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
|||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
CHOICES = ((1, "1: this"), (2, _("2: that")))
|
||||
CHOICES = ((1, "1: this漢"), (2, _("2: that漢")))
|
||||
|
||||
|
||||
class Pet(models.Model):
|
||||
|
|
Loading…
Reference in New Issue
Block a user