diff --git a/organize/party.py b/organize/party.py
index 64247b3..0fbc05b 100644
--- a/organize/party.py
+++ b/organize/party.py
@@ -24,6 +24,7 @@ from persistent.mapping import PersistentMapping
from zope import interface, component
from zope.app.principalannotation import annotations
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
+from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope.component import adapts
from zope.interface import implements
from zope.cachedescriptors.property import Lazy
@@ -60,10 +61,10 @@ def getPersonForUser(context, request=None, principal=None):
if context is None:
return None
if principal is None:
- if request is None:
- principal = getCurrentPrincipal()
- else:
+ if request is not None:
principal = getattr(request, 'principal', None)
+ else:
+ principal = getPrincipal(context)
if principal is None:
return None
loops = context.getLoopsRoot()
@@ -78,6 +79,15 @@ def getPersonForUser(context, request=None, principal=None):
return pa.get(util.getUidForObject(loops))
+def getPrincipal(context):
+ principal = getCurrentPrincipal()
+ if principal is not None:
+ if IUnauthenticatedPrincipal.providedBy(principal):
+ return None
+ return principal
+ return None
+
+
class Person(AdapterBase, BasePerson):
""" typeInterface adapter for concepts of type 'person'.
"""
diff --git a/organize/tracking/report.pt b/organize/tracking/report.pt
index 41ee48f..a34ed9f 100644
--- a/organize/tracking/report.pt
+++ b/organize/tracking/report.pt
@@ -79,7 +79,7 @@
- 1.1
|
diff --git a/organize/tracking/report.py b/organize/tracking/report.py
index d1ee35e..a019865 100644
--- a/organize/tracking/report.py
+++ b/organize/tracking/report.py
@@ -275,7 +275,9 @@ class TrackDetails(BaseView):
else:
title = view.listingTitle
versionable = IVersionable(self.object, None)
- version = versionable is not None and versionable.versionId or ''
+ version = ((versionable is not None and
+ not (versionable.notVersioned) and
+ versionable.versionId) or '')
return dict(object=obj, title=title,
type=self.longTypeTitle, url=url, version=version,
canAccess=canAccessObject(obj))