Compare commits
No commits in common. "fd6143b304c71ed4a1c9d01d867e36e2858f4b02" and "cd914c880fd75e5c42d482b3004a8a042e0f238b" have entirely different histories.
fd6143b304
...
cd914c880f
@ -9,7 +9,6 @@ Created on: 24.01.22
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from django.contrib.gis.geos import MultiPolygon
|
from django.contrib.gis.geos import MultiPolygon
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
|
||||||
from django.db.models import QuerySet
|
from django.db.models import QuerySet
|
||||||
|
|
||||||
from api.utils.serializer.serializer import AbstractModelAPISerializer
|
from api.utils.serializer.serializer import AbstractModelAPISerializer
|
||||||
@ -81,14 +80,10 @@ class AbstractModelAPISerializerV1(AbstractModelAPISerializer):
|
|||||||
json_str = str(json_str)
|
json_str = str(json_str)
|
||||||
if len(json_str) == 0:
|
if len(json_str) == 0:
|
||||||
return None
|
return None
|
||||||
try:
|
|
||||||
code = KonovaCode.objects.get(
|
code = KonovaCode.objects.get(
|
||||||
atom_id=json_str,
|
atom_id=json_str,
|
||||||
code_lists__in=[code_list_identifier]
|
code_lists__in=[code_list_identifier]
|
||||||
)
|
)
|
||||||
except ObjectDoesNotExist as e:
|
|
||||||
msg = f"{e.args[0]} ({json_str} not found in official list {code_list_identifier})"
|
|
||||||
raise ObjectDoesNotExist(msg)
|
|
||||||
return code
|
return code
|
||||||
|
|
||||||
def _created_on_to_json(self, entry):
|
def _created_on_to_json(self, entry):
|
||||||
|
Loading…
Reference in New Issue
Block a user