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

Datasets in logged in user dashboard resulting in ckan.logic.NotFound exception #81

Open
1 task done
ntwalibas opened this issue Oct 10, 2024 · 0 comments · May be fixed by #82
Open
1 task done

Datasets in logged in user dashboard resulting in ckan.logic.NotFound exception #81

ntwalibas opened this issue Oct 10, 2024 · 0 comments · May be fixed by #82
Assignees
Labels
bug Something isn't working

Comments

@ntwalibas
Copy link
Contributor

What happened?

When attempting to see the logged in user datasets from the user's dashboard, one may get a ckan.logic.NotFound exception.
We encountered this issue after loading IDSR data from DAGS.

The source of the issue is thatthe ID of the package/dataset that's passed to templates doesn't correspond to the ID that's actually available in the database and associated with the package/dataset.

Regression Test

  • Of course it is!

Version

latest

Relevant log output

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app

response = self.handle_exception(e)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app

response = self.full_dispatch_request()

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request

rv = self.handle_user_exception(e)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request

rv = self.dispatch_request()

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask_debugtoolbar/__init__.py", line 157, in dispatch_request

return view_func(**req.view_args)

File "/usr/lib/ckan/ckan/ckan/views/dashboard.py", line 53, in datasets

return base.render(u'user/dashboard_datasets.html', extra_vars)

File "/usr/lib/ckan/ckan/ckan/lib/base.py", line 107, in render

return flask_render_template(template_name, **extra_vars)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template

return _render(

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 128, in _render

rv = template.render(context)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render

self.environment.handle_exception()

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception

raise rewrite_traceback_stack(source=source)

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/user/dashboard_datasets.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckan/templates/user/dashboard_datasets.html", line 2, in top-level template code

{% set dataset_type = h.default_package_type() %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/user/dashboard.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckanext/activity/templates/user/dashboard.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckan/templates/user/dashboard.html", line 6, in top-level template code

{% set dataset_type = h.default_package_type() %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/user/edit_base.html", line 1, in top-level template code

{%  ckan_extends %}

File "/usr/lib/ckan/ckan/ckan/templates/user/edit_base.html", line 1, in top-level template code

{% extends "page.html" %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/page.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckanext/activity/templates/page.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckan/templates/page.html", line 1, in top-level template code

{% extends "base.html" %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/base.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckanext/activity/templates/base.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/src/ckanext-scheming/ckanext/scheming/templates/base.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/src/ckanext-googleanalytics/ckanext/googleanalytics/templates/base.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/src/ckanext-geoview/ckanext/geoview/templates/base.html", line 1, in top-level template code

{% ckan_extends %}

File "/usr/lib/ckan/ckan/ckan/templates/base.html", line 108, in top-level template code

{%- block page %}{% endblock -%}

File "/usr/lib/ckan/ckan/ckan/templates/page.html", line 19, in block 'page'

{%- block content %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/page.html", line 30, in block 'content'

{{ super() }}

File "/usr/lib/ckan/ckan/ckan/templates/page.html", line 22, in block 'content'

{% block main_content %}

File "/usr/lib/ckan/ckan/ckan/templates/page.html", line 74, in block 'main_content'

{% block primary %}

File "/usr/lib/ckan/ckan/ckan/templates/user/dashboard.html", line 39, in block 'primary'

{% block primary_content_inner %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/user/dashboard_datasets.html", line 18, in block 'primary_content_inner'

{% snippet 'snippets/package_list.html', packages=user_dict.datasets %}

File "/usr/lib/ckan/ckan/ckan/lib/jinja_extensions.py", line 277, in _call

return base.render_snippet(*args, **kwargs)

File "/usr/lib/ckan/ckan/ckan/lib/base.py", line 72, in render_snippet

output = render(template_name, extra_vars=kw)

File "/usr/lib/ckan/ckan/ckan/lib/base.py", line 107, in render

return flask_render_template(template_name, **extra_vars)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template

return _render(

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 128, in _render

rv = template.render(context)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render

self.environment.handle_exception()

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception

raise rewrite_traceback_stack(source=source)

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_list.html", line 14, in top-level template code

{% block package_list %}

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_list.html", line 17, in block 'package_list'

{% block package_list_inner %}

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_list.html", line 19, in block 'package_list_inner'

{% snippet 'snippets/package_item.html', package=package, item_class=item_class, hide_resources=hide_resources %}

File "/usr/lib/ckan/ckan/ckan/lib/jinja_extensions.py", line 277, in _call

return base.render_snippet(*args, **kwargs)

File "/usr/lib/ckan/ckan/ckan/lib/base.py", line 72, in render_snippet

output = render(template_name, extra_vars=kw)

File "/usr/lib/ckan/ckan/ckan/lib/base.py", line 107, in render

return flask_render_template(template_name, **extra_vars)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template

return _render(

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/flask/templating.py", line 128, in _render

rv = template.render(context)

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render

self.environment.handle_exception()

File "/usr/lib/ckan/.minikubevenv/ckan-ALitmJXH/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception

raise rewrite_traceback_stack(source=source)

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/snippets/package_item.html", line 6, in top-level template code

{%- set dataset_url = h.url_for('{}.read'.format(package.type), id=package.name) -%}

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_item.html", line 16, in top-level template code

{% block package_item %}

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_item.html", line 18, in block 'package_item'

{% block content %}

File "/usr/lib/ckan/ckan/ckan/templates/snippets/package_item.html", line 20, in block 'content'

{% block heading %}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/templates/snippets/package_item.html", line 17, in block 'heading'

{{_('Modified')}} {{ h.time_ago_from_timestamp(package.metadata_modified) }}, {{ h.get_last_modifier(package.id) }} · {{_('Downloads:')}} {{ h.get_package_stats(package.id) }}

File "/usr/lib/ckan/ckanext-who-afro/ckanext/who_afro/helpers.py", line 133, in get_last_modifier

package_activity = toolkit.get_action('package_activity_list')(

File "/usr/lib/ckan/ckan/ckan/logic/__init__.py", line 580, in wrapped

result = _action(context, data_dict, **kw)

File "/usr/lib/ckan/ckan/ckan/logic/__init__.py", line 681, in wrapper

return action(context, data_dict)

File "/usr/lib/ckan/ckan/ckanext/activity/logic/action.py", line 241, in package_activity_list

raise tk.ObjectNotFound()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant