Commit 5aeb096f authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Xiaowu Zhang

Only get selection_name if it exist

  Idea: This should be improved to reuse proxyfied field method
        instead directly.
parent bec6ea30
...@@ -762,12 +762,13 @@ class ProxyField(ZMIField): ...@@ -762,12 +762,13 @@ class ProxyField(ZMIField):
return proxy_field.get_value(id, **kw) return proxy_field.get_value(id, **kw)
def _cacheable_key(self): def _cacheable_key(self):
selection_name = self.get_value('selection_name') if self.has_value('selection_name'):
if selection_name is not None: selection_name = self.get_value('selection_name')
selection_tool = self.getPortalObject().portal_selections if selection_name is not None:
selection = selection_tool.getSelectionFor(selection_name, REQUEST = self.REQUEST) selection_tool = self.getPortalObject().portal_selections
if selection is not None: selection = selection_tool.getSelectionFor(selection_name, REQUEST = self.REQUEST)
return ("list_start", selection.getParams().get("list_start")) if selection is not None:
return ("list_start", selection.getParams().get("list_start"))
return "default" return "default"
def _getCacheId(self): def _getCacheId(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment