Feature

Todo

Docstrings (module, utilities)

Utilities

indico.modules.events.features.util.format_feature_names(names)
indico.modules.events.features.util.get_disallowed_features(event)

Get a set containing the names of features which are not available for an event.

indico.modules.events.features.util.get_enabled_features(event, only_explicit=False)

Return a set of enabled feature names for an event.

indico.modules.events.features.util.get_feature_definition(name)

Get a feature definition.

indico.modules.events.features.util.get_feature_definitions()

Get a dict containing all feature definitions.

indico.modules.events.features.util.is_feature_enabled(event, name)

Check if a feature is enabled for an event.

Parameters:
  • event – The event (or event ID) to check.

  • name – The name of the feature.

indico.modules.events.features.util.require_feature(event, name)

Raise a NotFound error if a feature is not enabled.

Parameters:
  • event – The event (or event ID) to check.

  • name – The name of the feature.

indico.modules.events.features.util.set_feature_enabled(event, name, state)

Enable/disable a feature for an event.

Parameters:
  • event – The event.

  • name – The name of the feature.

  • state – If the feature is enabled or not.

Returns:

Boolean indicating if the state of the feature changed.