djblets.privacy.consent.registry¶
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.
-
already_registered_error_class
[source]¶ alias of
djblets.privacy.consent.errors.ConsentRequirementConflictError
-
lookup_error_class
[source]¶ 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]¶
-
get_consent_requirement
(requirement_id)[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
-
-
get_consent_requirements_registry
()[source]¶ Return the registry for managing consent requirements.
Returns: The registry for consent requirements. Return type: ConsentRequirementsRegistry