Skip to content

Commit

Permalink
fix fix should_store_payload_and_result for ckan 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Nov 25, 2024
1 parent 415d8c5 commit 900cb95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/event_audit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CONF_API_TRACK_ENABLED = "ckanext.event_audit.track_api"

CONF_STORE_PAYLOAD_AND_RESULT = "ckanext.event_audit.store_payload_and_result"
DEF_STORE_PAYLOAD_AND_RESULT = False

CONF_BATCH_SIZE = "ckanext.event_audit.batch.size"
CONF_BATCH_TIMEOUT = "ckanext.event_audit.batch.timeout"
Expand Down Expand Up @@ -82,7 +83,7 @@ def is_api_log_enabled() -> bool:
def should_store_payload_and_result() -> bool:
"""Check if the payload and result should be stored in the event. Works
only for in-built listeners."""
return tk.config[CONF_STORE_PAYLOAD_AND_RESULT]
return tk.config.get(CONF_STORE_PAYLOAD_AND_RESULT, DEF_STORE_PAYLOAD_AND_RESULT)


def get_batch_size() -> int:
Expand Down
1 change: 1 addition & 0 deletions ckanext/event_audit/config_declaration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ groups:
description: A list of models to track
type: list
editable: true
default: ""

- key: ckanext.event_audit.store_payload_and_result
description: Store the payload and result of the event
Expand Down

0 comments on commit 900cb95

Please sign in to comment.