style(import): str(v) == str(val)

dev
Angelo 2023-09-30 02:54:39 +08:00
parent 9a811c4fcb
commit 01585e1e78
1 changed files with 21 additions and 20 deletions

View File

@ -37,6 +37,7 @@ class ImportSerializerMixin:
try:
import unicodedata
unicodedata.numeric(num)
return True
except (TypeError, ValueError):
@ -221,7 +222,6 @@ class ImportSerializerMixin:
for h_index, h_item in enumerate(hidden_header):
for key, val in results.items():
if key == h_item:
select_field = self.import_field_dict.get(key) if key in self.import_field_dict.keys() else None
choices = (
@ -229,7 +229,7 @@ class ImportSerializerMixin:
)
if choices.get("data"):
for k, v in choices.get("data").items():
if v == val:
if str(v) == str(val):
val = k
elif choices.get("queryset") and choices.get("values_name"):
data_list = choices.get("queryset").values(choices.get("values_name"), "id")
@ -290,6 +290,7 @@ class ExportSerializerMixin:
try:
import unicodedata
unicodedata.numeric(num)
return True
except (TypeError, ValueError):