Available signals

ephios.core.signals.event_forms = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of form instances to show on the event create and update views. You receive an Optional[event] and request keyword arg you should use to create an instance of your form. Subclass ephios.core.forms.events.BasePluginFormMixin to customize the rendering behavior. If all forms are valid, save will be called on your form.

ephios.core.signals.event_menu = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of actions that a user can perform on a single event. The actions are displayed in the dropdown menu on the event detail view. Receivers receive a event and request keyword argument. Each action is represented by a dict with the keys url, label and icon.

This signal is sent out to get links for that page footer. Receivers should return a dict of with keys being the text and values being the url to link to. Receivers will receive a request keyword argument.

ephios.core.signals.insert_html = <ephios.core.plugins.PluginSignal object>

This signal allows you to put html in various places. You will get the request as the keyword argument request and are expected to return HTML. Try to use html elements that fit the existing document structure. Return an empty string to not render anything.

The sender argument specifies the template location and can be one of these constants:

  • HTML_HEAD: Add HTML in the <head> tag.

  • HTML_NAVBAR: Add HTML in the navbar.

  • HTML_EVENT_INFO: Add HTML to the event detail page event info box. Comes with an event kwarg.

  • HTML_SHIFT_INFO: Add HTML to the event detail page shift box. Comes with a shift kwarg.

  • HTML_HOMEPAGE_INFO: Add HTML to the homepage content area.

  • HTML_PERSONAL_DATA_PAGE: Add HTML to the settings “personal data” page of the logged-in user.

  • HTML_DISPOSITION_PARTICIPATION: Add HTML to the expandable details view of a participation form in the disposition view. Comes with a participation kwarg.

This signal is sent out to get links for the main navbar. Receivers should return a list of dicts containing key-value-pairs for ‘label’, ‘url’ and a boolean flag ‘active’. An optional key ‘group’ can contain a label for a group under which the link should be displayed. The special group NAV_USERPROFILE_KEY is reserved for the group under the users name. Receivers will receive a request keyword argument.

ephios.core.signals.oidc_update_user = <ephios.core.plugins.PluginSignal object>

This signal is sent out to update a user when they login with oidc. Receivers receive user and claims keyword arguments with a user object and the claims from the oidc provider.

ephios.core.signals.participant_from_request = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a participant from a request with an unauthenticated user. Return a subclass of AbstractParticipant or None if you cannot provide a participant. The first non-None return-value will be used. Receivers will receive a request keyword argument.

ephios.core.signals.participant_signup_checkers = <ephios.core.plugins.PluginSignal object>

This signal is sent out so receivers can prevent signup for a shift or provide feedback for dispatchers. Receivers are expected to return a list of functions receiving a method and participant argument and optionally raising fitting subclasses of ephios.core.signup.checkers.SignupActionError.

ephios.core.signals.participation_finished = <ephios.core.plugins.PluginSignal object>

This signal is sent out once for every confirmed participation after the participation ended and the finished flag is set to True. Changing the shift date to the future will not cause this to be called again. Exceptions in receivers are ignored, so make sure your code is robust enough to handle errors and retry if needed. This signal is based on periodic_signal and provides a participation keyword argument.

ephios.core.signals.periodic_signal = <ephios.core.plugins.PluginSignal object>

This signal is called periodically, at least every 15 minutes.

ephios.core.signals.provide_dynamic_settings = <ephios.core.plugins.PluginSignal object>

Use this signal to overwrite the defaults of django settings accessed using ephios.core.signals.DynamicSettingsProxy. Receivers receive a name keyword argument naming the setting.

ephios.core.signals.register_consequence_handlers = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all known consequence handlers. Receivers should return a list of subclasses of ephios.core.consequences.BaseConsequenceHandler.

ephios.core.signals.register_event_bulk_action = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of actions that a user can perform on a list of events. Receivers should return a list of actions. Each action is represented by a dict with the keys url, label and icon. Once the user wants to perform the action, a POST request will be issued to this URL. The bulk_action field will contain a list of event ids on which the action should be performed.

ephios.core.signals.register_group_permission_fields = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of permission fields that should be displayed on the group form. Receivers should return a list of tuples of the form (field_name, field). field must be an instance of ephios.extra.permissions.PermissionField.

ephios.core.signals.register_healthchecks = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all health checks that can be run to monitor the health of the application. Receivers should return a list of subclasses of ephios.core.services.health.AbstractHealthCheck

ephios.core.signals.register_notification_backends = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all backends that can handle sending out notifications. Receivers should return a list of subclasses of ephios.core.notifications.backends.AbstractNotificationBackend

ephios.core.signals.register_notification_types = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all notification types that can be sent out to a user or participant. Receivers should return a list of subclasses of ephios.core.notifications.types.AbstractNotificationHandler

ephios.core.signals.register_shift_structures = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all known shift structures. Receivers should return a list of subclasses of ephios.core.signup.structure.abstract.AbstractShiftStructure.

ephios.core.signals.register_signup_flows = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get all known signup flows. Receivers should return a list of subclasses of ephios.core.signup.flow.abstract.AbstractSignupFlow.

ephios.core.signals.settings_sections = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get sections for the settings. Receivers should return a list of dicts containing key-value-pairs for ‘label’, ‘url’, ‘group’ and a boolean flag ‘active’. Only views that the current user is allowed to view should be returned. Common group choices are SETTINGS_PERSONAL_SECTION_KEY and SETTINGS_MANAGEMENT_SECTION_KEY but can be any other value as well. Receivers will receive a request keyword argument.

ephios.core.signals.shift_action = <ephios.core.plugins.PluginSignal object>

This signal is sent out to collect additional actions that managers can perform on on a shift. For each action, a button will be displayed in the shift card next to the disposition button. Receivers of the signal will receive the shift and request and are expected to return an array of {label: str, url: str} dicts, representing the available actions. The buttons will only be shown to responsibles of the respective shift.

ephios.core.signals.shift_copy = <ephios.core.plugins.PluginSignal object>

This signal is set out after a shift got copied to allow plugins to copy related data as well. Receivers will receive the original shift and a list of the created copies.

ephios.core.signals.shift_forms = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of form instances to show on the shift create and update views. You receive a shift and request keyword arg you should use to create an instance of your form. Subclass ephios.core.forms.events.BasePluginFormMixin to customize the rendering behavior. If all forms are valid, save will be called on your form.

ephios.core.signals.signup_form_fields = <ephios.core.plugins.PluginSignal object>

This signal is sent out to get a list of form fields to show on the signup view, especially to collect user input for shift structures. Receivers will receive the shift, participant, participation, and signup_choice and should return a dict in the form ``{ ‘fieldname1’: {

‘label’:, …, ‘help_text’:, …, ‘default’: …, ‘required’: …, # meaning a non-Falsey value must be provided ‘form_class’: …, ‘form_kwargs’: …, ‘serializer_class’: …, ‘serializer_kwargs’: …, }, ‘fieldname2: { … } }``.

label (only form), help_text (only form), default (only form, as initial), and required (form and serializer) will be applied to the kwargs dicts for convenience. Values specified directly as kwarg have precedence.

ephios.core.signals.signup_save = <ephios.core.plugins.PluginSignal object>

This signal is sent out to when a signup is created or modified to allow plugins to handle additional user input. Receivers will receive the shift, participant, participation, signup_choice, and cleaned_data.