notify new elements with added event
This commit is contained in:
parent
93fa1c1f46
commit
99480fb9fe
|
@ -10,6 +10,10 @@ from Products.CMFCore.utils import getToolByName
|
|||
from Products.Five.browser import BrowserView
|
||||
from plone.namedfile.file import NamedBlobFile
|
||||
|
||||
from zope.event import notify
|
||||
from zope.lifecycleevent import ObjectAddedEvent, ObjectModifiedEvent
|
||||
|
||||
|
||||
import transaction
|
||||
|
||||
import themis.config.utils
|
||||
|
@ -133,10 +137,12 @@ class LoadFromOcr(BrowserView):
|
|||
|
||||
folder.invokeFactory(factory, id=ocr_id, title=ocr_title,
|
||||
fichier=ocr_file, **kwargs)
|
||||
|
||||
os.rename(os.path.join(base, filename),
|
||||
os.path.join(base, filename + '.processed'))
|
||||
transaction.commit()
|
||||
|
||||
object = getattr(folder, ocr_id)
|
||||
notify(ObjectAddedEvent(object))
|
||||
|
||||
return 'OK'
|
||||
|
||||
|
|
Reference in New Issue