Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use the calendar tool to discover Event-like objects as it was removed on Plone 5 #600

Merged
merged 1 commit into from Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,10 @@ There's a frood who really knows where his towel is.
1.0a13 (unreleased)
^^^^^^^^^^^^^^^^^^^

- Do not use the calendar tool to discover Event-like objects as it was removed on Plone 5.
Instead, try to guess if an object is an Event by using its catalog metadata.
[hvelarde]

- Package is now also tested with plone.app.contenttypes installed;
a few bugs related with API incompatibilities among Archetypes and Dexterity were fixed.
[hvelarde]
Expand Down
8 changes: 1 addition & 7 deletions src/collective/cover/tiles/base.py
Expand Up @@ -351,15 +351,9 @@ def Date(self, brain):
event's start date in case of an Event-like object
:rtype: str or DateTime
"""
calendar = api.portal.get_tool('portal_calendar')
# calendar_types lists all Event-like content types
if brain.portal_type not in calendar.calendar_types:
# return callable date for content listing objects or date
# as string for catalog/brain objects.
if brain.start == Missing.Value:
return brain.Date() if callable(brain.Date) else brain.Date
else:
# an Event must have a start date
assert brain.start is not Missing.Value
return brain.start

def get_localized_time(self, datetime, format):
Expand Down