Jump to >


Registry for things that require consent from a user.

class ConsentRequirementsRegistry[source]

Bases: djblets.registries.registry.OrderedRegistry

A registry for managing aspects of a product requiring consent.

Each requirement in the registry requires consent by the user before the action or processing for that requirement is allowed to occur.

lookup_attrs = (u'requirement_id',)[source]

alias of djblets.privacy.consent.errors.ConsentRequirementConflictError


alias of djblets.privacy.consent.errors.ConsentRequirementNotFoundError

default_errors = {u'already_registered': u'Could not register consent requirement %(item)s: This requirement is already registered or its ID conflicts with another consent requirement.', u'attribute_registered': u'Could not register consent requirement %(item)s: Another requirement (%(duplicate)s) is already registered with the same ID.', u'invalid_attribute': u'"%(attr_name)s" is not a registered lookup attribute.', u'load_entry_point': u'Could not load entry point %(entry_point)s: %(error)s.', u'missing_attribute': u'Could not register %(item)s: it does not have a "%(attr_name)s" attribute.', u'not_registered': u'No item registered with %(attr_name)s = %(attr_value)s.', u'unregister': u'Could not unregister consent requirement %(item)s: This requirement was not yet registered.'}[source]

Return a consent requirement with the given ID.

Parameters:requirement_id (unicode) – The consent requirement ID to look up.
Returns:The resulting consent requirement, if found. If a requirement with this ID could not be found, this will return None.
Return type:djblets.privacy.consent.base.BaseConsentRequirement

Return the registry for managing consent requirements.

Returns:The registry for consent requirements.
Return type:ConsentRequirementsRegistry