Skip to content

Commit

Permalink
chore: address suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 12, 2024
1 parent fb9d6fe commit 6dbd822
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openedx_events/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def general_signal_handler(sender, signal, **kwargs): # pylint: disable=unused-
# "topic_b": { "event_key_field": "my.key.field", "enabled": False }
# }"
if kwargs.get(SIGNAL_PROCESSED_FROM_EVENT_BUS) is True:
logger.info(f"Signal already processed on the Event Bus {signal.event_type}, skipping...")
logger.debug(f"Signal already processed on the Event Bus {signal.event_type}, skipping...")
return

event_data = {key: kwargs.get(key) for key in signal.init_data}
Expand Down
4 changes: 3 additions & 1 deletion openedx_events/tests/test_producer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ def test_enabled_disabled_events(self, mock_producer):
@patch('openedx_events.apps.get_producer')
def test_events_with_custom_metadata_disabled(self, mock_producer, mock_logger):
"""
Check whether XBLOCK_PUBLISHED is connected to the handler and the handler only produces enabled events.
Check wheter XBLOCK_PUBLISHED is connected to the handler and the handler
do not send any events as the signal is marked "from_event_bus".
Args:
mock_producer: mock get_producer to inspect the arguments.
mock_logger: mock logger to inspect the arguments.
"""
mock_send = Mock()
mock_producer.return_value = mock_send
Expand Down

0 comments on commit 6dbd822

Please sign in to comment.