Skip to content

Commit

Permalink
fix: enable activity fix only if plugin is enabled v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Mar 28, 2023
1 parent b80026b commit bca2729
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ckanext/core_fix/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,21 @@
log = logging.getLogger(__name__)


if p.plugin_loaded('activity'):
@tk.chained_helper
def dashboard_activity_stream(
next_func: Callable[..., Any], *args, **kw: Any # type: ignore
) -> list[dict[str, Any]]:
"""
Insert `offset` positional argument
If kw isn't empty, we are started to pass kw args properly
def dashboard_activity_stream(
next_func: Callable[..., Any], *args, **kw: Any # type: ignore
) -> list[dict[str, Any]]:
"""
Insert `offset` positional argument
If kw isn't empty, we are started to pass kw args properly
https://github.com/ckan/ckan/pull/7482
"""
https://github.com/ckan/ckan/pull/7482
"""

if not kw:
args: list[Any] = list(args)
args.insert(3, 0)
if not kw:
args: list[Any] = list(args)
args.insert(3, 0)

return next_func(*args, **kw)
return next_func(*args, **kw)


def get_fixes_with_css() -> list[str]:
Expand All @@ -43,7 +41,9 @@ def get_helpers():
"cf_get_fixes_with_css": get_fixes_with_css,
}

if p.plugin_loaded('activity'):
if p.plugin_loaded("activity"):
tk.chained_helper(dashboard_activity_stream)

helpers["dashboard_activity_stream"] = dashboard_activity_stream

if utils.is_fix_disabled(conf.Fixes.dashboard_activity):
Expand Down

0 comments on commit bca2729

Please sign in to comment.