Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update signal receiver how-to #422

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions docs/how-tos/using-events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,9 @@ Connecting signals can be done using regular django syntax:
def your_receiver_function(**kwargs):
# your implementation here


Or at the apps.py

.. code-block:: python

{
"signals_config": {
"lms.djangoapp": {
"relative_path": "your_module_name",
"receivers": [
{
"receiver_func_name": "your_receiver_function",
"signal_path": "openedx_events.learning.signals.STUDENT_REGISTRATION_COMPLETED",
},
],
}
}
}


In case you are listening to an event in an Open edX platform repo, you can directly
use the django syntax since the apps.py method will not be available without the
plugin system.
.. note::
You may encounter an older pattern for configuring signal receivers that is no longer recommended. This
outdated Django plugin configuration used ``plugin_app`` and ``signals_config`` in apps.py.

.. warning::
For non-trivial work, we encourage using asynchronous tasks in your receiver functions in order
Expand Down