Skip to content

Commit

Permalink
Update error handling #123
Browse files Browse the repository at this point in the history
  • Loading branch information
johnatawnclementawn committed Nov 20, 2024
1 parent 47151b4 commit c6e6f59
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions arches_lingo/etl_modules/migrate_to_lingo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.db import connection
from django.db.models import OuterRef, Subquery
from django.db.models.functions import Coalesce
from django.utils.translation import gettext as _
from arches.app.datatypes.datatypes import DataTypeFactory
from arches.app.etl_modules.save import save_to_tiles
from arches.app.etl_modules.decorators import load_data_async
Expand Down Expand Up @@ -454,9 +455,14 @@ def init_relationships(
elif concept_has_part_of_scheme and existing_scheme == root_list:
continue
elif concept_has_part_of_scheme and existing_scheme != root_list:
raise Exception(
f"Concept {resourceinstanceid} cannot have multiple schemes: {root_list} and {concepts_with_scheme[resourceinstanceid]}"
)
return {
"status": 400,
"success": False,
"title": "Concepts may only participate in one scheme",
"message": _(
f"Concept {resourceinstanceid} cannot have multiple schemes: {root_list} and {concepts_with_scheme[resourceinstanceid]}"
),
}

value_obj = {
str(CONCEPTS_PART_OF_SCHEME_NODEGROUP_ID): {
Expand Down

0 comments on commit c6e6f59

Please sign in to comment.