Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dashboard_activity_list_html() doesn't pass the user id to activity_list_to_html() #2346

@clementmouchet

Description

@clementmouchet

The load more functionality in the dashboard doesn't work, because the id that is used to query more data is not passed to the template.

I've fixed it by passing the context user id:

diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py
index ad59266..2519744 100644
--- a/ckan/logic/action/get.py
+++ b/ckan/logic/action/get.py

@@ -3216,8 +3221,6 @@ def dashboard_activity_list_html(context, data_dict):
     The activity stream is rendered as a snippet of HTML meant to be included
     in an HTML page, i.e. it doesn't have any HTML header or footer.

-    :param id: the id or name of the user
-    :type id: string
     :param offset: where to start getting activity items from
         (optional, default: 0)
     :type offset: int
@@ -3233,6 +3236,7 @@ def dashboard_activity_list_html(context, data_dict):
     model = context['model']
     offset = data_dict.get('offset', 0)
     extra_vars = {
+        'id': model.User.get(context['user']).id,
         'controller': 'user',
         'action': 'dashboard',
         'offset': offset,

Will submit a PR asap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions