Skip to content

Commit

Permalink
fix: do not use get it breaks if there is conversaiton on the page (a…
Browse files Browse the repository at this point in the history
…quisition)
  • Loading branch information
toutpt committed Dec 16, 2013
1 parent b73b202 commit abcd347
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions collective/portlet/favoriting/favoritingportlet.py
Expand Up @@ -26,7 +26,7 @@ class IFavoritingPortlet(IPortletDataProvider):

title = schema.TextLine(title=_p(u"Title"), required=False)

portal_type = schema.Choice(
ptype = schema.Choice(
title=_p(u"Content Type"),
required=False,
vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"
Expand All @@ -51,11 +51,11 @@ class Assignment(base.Assignment):

title = None
limit = None
portal_type = None
ptype = None

def __init__(self, title=None, portal_type=None, limit=None):
def __init__(self, title=None, ptype=None, limit=None):
self._title = title
self.portal_type = portal_type
self.ptype = ptype
self.limit = limit

@property
Expand All @@ -82,10 +82,10 @@ def get_favorites(self):
manager = self.context.restrictedTraverse(VIEW_NAME)
query = {}
query["sort_on"] = "sortable_title"
limit = self.data.get("limit", None)
limit = self.data.limit
if limit is not None:
query["limit"] = limit
portal_type = self.data.get("portal_type", None)
portal_type = self.data.ptype
if portal_type is not None:
query["portal_type"] = portal_type
return manager.get(query=query)
Expand Down

0 comments on commit abcd347

Please sign in to comment.