utils: notify of modified object when mimetype is changed

This commit is contained in:
Frédéric Péters 2015-01-23 16:08:11 +01:00
parent e1890d0ea5
commit 423b3f7cff
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,7 @@
import os
from zope.event import notify
from zope.lifecycleevent import ObjectModifiedEvent
from zope.component import getUtility
from zope.schema.interfaces import IVocabularyFactory
@ -85,4 +87,5 @@ class FixMime(BrowserView):
if self.context.file.contentType == new_mime:
return 'No change'
self.context.file.contentType = new_mime
notify(ObjectModifiedEvent(self.context))
return 'OK'