Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpublished graph resources show in search #10645

Open
SDScandrettKint opened this issue Mar 4, 2024 · 0 comments
Open

Unpublished graph resources show in search #10645

SDScandrettKint opened this issue Mar 4, 2024 · 0 comments

Comments

@SDScandrettKint
Copy link
Member

Found in V7.

Resources that are under a graph that is unpublished will still remain in the search results. Clicking on one of the resources results in endless loading. The Arches server log will show the following error:

Internal Server Error: /api/resource_report/e7067530-1f70-4ee3-a53d-629b8f9e1ea6
Traceback (most recent call last):
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/arches/arches/app/views/api.py", line 108, in dispatch
    return super(APIBase, self).dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/arches/arches/app/views/api.py", line 1111, in get
    "report_json": resource.to_json(compact=compact, version=version),
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/arches/arches/app/models/resource.py", line 783, in to_json
    return LabelBasedGraphV2.from_resource(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/arches/arches/app/utils/label_based_graph_v2.py", line 217, in from_resource
    published_graph = models.PublishedGraph.objects.get(publication=resource.graph.publication, language=user_language)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/arches_dev/v7_development/env3.11_v7dev/lib/python3.11/site-packages/django/db/models/query.py", line 637, in get
    raise self.model.DoesNotExist(
arches.app.models.models.PublishedGraph.DoesNotExist: PublishedGraph matching query does not exist.
[04/Mar/2024 03:28:40] "GET /api/resource_report/e7067530-1f70-4ee3-a53d-629b8f9e1ea6?v=beta&uncompacted=true HTTP/1.1" 500 135267

And the browser console will also show a network error:
image

Additionally, the search Resource Type filter also shows the unpublished graph in the dropdown (similar to #9435 in V6)

It seems logical to hide all resources that have an unpublished model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant