Commit 001ca9bc authored by Nicolas Delaby's avatar Nicolas Delaby

Do not using List as default parameter

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16777 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9d7783d
......@@ -56,6 +56,8 @@ from Acquisition import Implicit, aq_base
from Products.ERP5Type.Message import Message
import warnings
_MARKER = []
class SelectionError( Exception ):
pass
......@@ -483,18 +485,18 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
selection.edit(stats=stats)
security.declareProtected(ERP5Permissions.View, 'getSelectionStats')
def getSelectionStats(self, selection_name, stats=[' ',' ',' ',' ',' ',' '], REQUEST=None):
def getSelectionStats(self, selection_name, stats=_MARKER, REQUEST=None):
"""
Returns the stats in the selection
"""
if stats is not _MARKER:
default_stats = stats
else:
default_stats = [' '] * 6
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None:
try:
return selection.stats
except AttributeError:
return stats # That is really bad programming XXX
else:
return stats
return getattr(selection, stats, default_stats)
return default_stats
security.declareProtected(ERP5Permissions.View, 'viewFirst')
......
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