[gen] pod field: bugfix with attr 'formats' without method 'showTemplate'; [shared] bugfix: renamed module ldap to ldap_connector.
This commit is contained in:
parent
5ac8e71a6f
commit
c2676c9cf8
7 changed files with 25 additions and 26 deletions
|
@ -11,7 +11,7 @@ from appy.gen.descriptors import ClassDescriptor
|
|||
from appy.shared import mimeTypes
|
||||
from appy.shared import utils as sutils
|
||||
from appy.shared.data import languages
|
||||
from appy.shared.ldap import LdapConnector
|
||||
from appy.shared.ldap_connector import LdapConnector
|
||||
try:
|
||||
from AccessControl.ZopeSecurityPolicy import _noroles
|
||||
except ImportError:
|
||||
|
@ -1257,7 +1257,7 @@ class ToolMixin(BaseMixin):
|
|||
def generateUid(self, className):
|
||||
'''Generates a UID for an instance of p_className.'''
|
||||
name = className.split('_')[-1]
|
||||
randomNumber = str(random.random()).split('.')[1]
|
||||
randomNumber = str(random.random()).split('.')[1].replace('e-', '')
|
||||
timestamp = ('%f' % time.time()).replace('.', '')
|
||||
return '%s%s%s' % (name, timestamp, randomNumber)
|
||||
|
||||
|
|
|
@ -171,12 +171,11 @@ class BaseMixin:
|
|||
history = []
|
||||
from DateTime import DateTime
|
||||
eventToDelete = DateTime(rq['eventTime'])
|
||||
key = self.workflow_history.keys()[0]
|
||||
for event in self.workflow_history[key]:
|
||||
for event in self.workflow_history['appy']:
|
||||
if (event['action'] != '_datachange_') or \
|
||||
(event['time'] != eventToDelete):
|
||||
history.append(event)
|
||||
self.workflow_history[key] = tuple(history)
|
||||
self.workflow_history['appy'] = tuple(history)
|
||||
appy = self.appy()
|
||||
self.log('data change event deleted for %s (UID=%s).' % \
|
||||
(appy.klass.__name__, appy.uid))
|
||||
|
@ -606,8 +605,7 @@ class BaseMixin:
|
|||
event.update(kw)
|
||||
if 'review_state' not in event: event['review_state'] = self.State()
|
||||
# Add the event to the history
|
||||
histKey = self.workflow_history.keys()[0]
|
||||
self.workflow_history[histKey] += (event,)
|
||||
self.workflow_history['appy'] += (event,)
|
||||
|
||||
def addDataChange(self, changes, notForPreviouslyEmptyValues=False):
|
||||
'''This method allows to add "manually" a data change into the objet's
|
||||
|
@ -1384,8 +1382,7 @@ class BaseMixin:
|
|||
break
|
||||
else:
|
||||
# Return info about the current object state
|
||||
key = self.workflow_history.keys()[0]
|
||||
res = self.workflow_history[key][-1]['review_state']
|
||||
res = self.workflow_history['appy'][-1]['review_state']
|
||||
# Return state name or state definition?
|
||||
if name: return res
|
||||
else: return getattr(wf, res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue