Skip to content

Commit

Permalink
Changed param ordering of offset and limit within activity_list funct…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
johnmartin committed Nov 20, 2012
1 parent cdf6da0 commit a2423eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions ckan/logic/action/get.py
Expand Up @@ -1736,7 +1736,7 @@ def user_activity_list(context, data_dict):
model = context['model']
user_id = _get_or_bust(data_dict, 'id')
offset = _get_or_bust(data_dict, 'offset')
activity_objects = model.activity.user_activity_list(user_id, offset)
activity_objects = model.activity.user_activity_list(user_id, 31, offset)
return model_dictize.activity_list_dictize(activity_objects, context)

def package_activity_list(context, data_dict):
Expand All @@ -1753,9 +1753,12 @@ def package_activity_list(context, data_dict):
# FIXME: Filter out activities whose subject or object the user is not
# authorized to read.
_check_access('package_show', context, data_dict)

offset = data_dict['offset']
model = context['model']
package_id = _get_or_bust(data_dict, 'id')
activity_objects = model.activity.package_activity_list(package_id)

activity_objects = model.activity.package_activity_list(package_id, 31, offset)
return model_dictize.activity_list_dictize(activity_objects, context)

def group_activity_list(context, data_dict):
Expand Down Expand Up @@ -2241,7 +2244,7 @@ def dashboard_activity_list(context, data_dict):

# FIXME: Filter out activities whose subject or object the user is not
# authorized to read.
activity_objects = model.activity.dashboard_activity_list(user_id, offset)
activity_objects = model.activity.dashboard_activity_list(user_id, 31, offset)

activity_dicts = model_dictize.activity_list_dictize(
activity_objects, context)
Expand Down
8 changes: 4 additions & 4 deletions ckan/model/activity.py
Expand Up @@ -104,7 +104,7 @@ def _user_activity_query(user_id):
return q


def user_activity_list(user_id, offset=0, limit=31):
def user_activity_list(user_id, limit=31, offset=0):
'''Return the given user's public activity stream.
Returns all activities from or about the given user, i.e. where the given
Expand All @@ -126,7 +126,7 @@ def _package_activity_query(package_id):
return q


def package_activity_list(package_id, offset=0, limit=15):
def package_activity_list(package_id, limit=31, offset=0):
'''Return the given dataset (package)'s public activity stream.
Returns all activities about the given dataset, i.e. where the given
Expand Down Expand Up @@ -165,7 +165,7 @@ def _activities_from_everything_followed_by_user_query(user_id):
return q


def activities_from_everything_followed_by_user(user_id, offset=0, limit=31):
def activities_from_everything_followed_by_user(user_id, limit=31, offset=0):
'''Return activities from everything that the given user is following.
Returns all activities where the object of the activity is anything
Expand All @@ -182,7 +182,7 @@ def _dashboard_activity_query(user_id):
return q


def dashboard_activity_list(user_id, offset=0, limit=31):
def dashboard_activity_list(user_id, limit=31, offset=0):
'''Return the given user's dashboard activity stream.
Returns activities from the user's public activity stream, plus
Expand Down

0 comments on commit a2423eb

Please sign in to comment.