Skip to content

Commit

Permalink
Avoid ComponentLookupError when adding a Plone site
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Apr 23, 2018
1 parent d287ac6 commit ba3dd84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Changelog
1.7 (unreleased)
----------------

- Avoid ``ComponentLookupError`` when adding a Plone site (fixes `#85 <https://github.com/collective/collective.fingerpointing/issues/85>`_).
[hvelarde]

- Do not fail while logging uninstall profile information.
[hvelarde]

Expand Down Expand Up @@ -204,7 +207,7 @@ Changelog
- Make control panel configlet accesible to Site Administrator role (closes `#15`_).
[hvelarde]

- Avoid `ComponentLookupError` when removing a Plone site (fixes `#4`_).
- Avoid ``ComponentLookupError`` when removing a Plone site (fixes `#4`_).
[hvelarde]

- Remove unused plone.directives.form dependency which pulled in Grok packages.
Expand Down
Expand Up @@ -5,13 +5,18 @@
from collective.fingerpointing.logger import log_info
from collective.fingerpointing.utils import get_request_information
from plone import api
from zope.component.interfaces import ComponentLookupError


def profile_imports_logger(event):
"""Log Generic Setup profile imports."""
name = IFingerPointingSettings.__identifier__ + '.audit_profile_imports'
audit_profile_imports = api.portal.get_registry_record(name, default=False)
if not audit_profile_imports:
try:
audit_enabled = api.portal.get_registry_record(name, default=False)
except ComponentLookupError: # adding Plone site
return

if not audit_enabled:
return

try:
Expand Down

0 comments on commit ba3dd84

Please sign in to comment.