Skip to content

Commit

Permalink
Merge pull request #122 from arthur-schnitzler/115-network-autocomplete
Browse files Browse the repository at this point in the history
potential fix for broken network autocomplete
  • Loading branch information
csae8092 authored Jan 27, 2024
2 parents e0f07fc + 15ecf67 commit f4de7f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis_core/apis_metainfo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def merge_with(self, entities):
if not isinstance(entities, list) and not isinstance(entities, QuerySet):
entities = [entities]
entities = [
self_model_class.objects.get(pk=ent) if type(ent) == int else ent
self_model_class.objects.get(pk=ent) if type(ent) == int else ent # noqa: E721
for ent in entities
]
rels = ContentType.objects.filter(
Expand Down Expand Up @@ -304,7 +304,7 @@ def merge_with(self, entities):
for u in Uri.objects.filter(entity=ent):
u.entity = self
u.save()
for l in Label.objects.filter(temp_entity=ent):
for l in Label.objects.filter(temp_entity=ent): # noqa: E741
l.temp_entity = self
l.save()
for r in rels.filter(model__icontains=e_b):
Expand Down
6 changes: 6 additions & 0 deletions apis_core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from apis_core.apis_metainfo.views import beacon
from apis_core.apis_vocabularies.api_views import UserViewSet
from apis_core.helper_functions.ContentType import GetContentTypes
from apis_core.apis_entities.autocomplete3 import GenericEntitiesAutocomplete

app_name = "apis_core"

Expand Down Expand Up @@ -37,6 +38,11 @@
else:
urlpatterns = [
path("api/", include((router.urls, "apis_core"), namespace="apis_api")),
path(
"api/entities/autocomplete-network/<entity>/",
GenericEntitiesAutocomplete.as_view(),
name="network-ac",
),
path("beacon/", beacon, name="beacon"),
path("labels/", include("apis_core.apis_labels.urls", namespace="apis_labels")),
path("tei/", include("apis_core.apis_tei.tei_urls", namespace="apis_tei")),
Expand Down

0 comments on commit f4de7f2

Please sign in to comment.