[gen] One can define statis attribute 'showHistory', being a method or a boolean value. It indicates if the history is visible or not. Added on the User, passwords fields on the main page. This way, when creating a user, those fields are used. When the user wants to change it own password, passwords on the 'passwords' page are then used.

This commit is contained in:
Gaetan Delannay 2014-11-25 14:56:38 +01:00
parent 1d721d61f4
commit 02a7be98ff
3 changed files with 55 additions and 24 deletions

View file

@ -1111,6 +1111,13 @@ class BaseMixin:
becomes: has this object an history for field p_name?'''
if not hasattr(self.aq_base, 'workflow_history') or \
not self.workflow_history: return
# Return False if the user can't consult the object history
klass = self.getClass()
if hasattr(klass, 'showHistory'):
show = klass.showHistory
if callable(show): show = klass.showHistory(self.appy())
if not show: return
# Get the object history
history = self.workflow_history['appy']
if not name:
for event in history: