Commit 4301022c authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent b9a33c40
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
############################################################################## ##############################################################################
from DateTime import DateTime from DateTime import DateTime
from io import BytesIO
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Base import WorkflowMethod from Products.ERP5Type.Base import WorkflowMethod
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
...@@ -102,6 +103,8 @@ class File(Document, OFS_File): ...@@ -102,6 +103,8 @@ class File(Document, OFS_File):
""" """
if 'file' in kw: if 'file' in kw:
file_object = kw.pop('file') file_object = kw.pop('file')
if type(file_object) is bytes:
file_object = BytesIO(file_object)
filename = getattr(file_object, 'filename', None) filename = getattr(file_object, 'filename', None)
# if file field is empty(no file is uploaded), # if file field is empty(no file is uploaded),
# filename is empty string. # filename is empty string.
......
...@@ -465,11 +465,14 @@ def synchronizeDynamicModules(context, force=False): ...@@ -465,11 +465,14 @@ def synchronizeDynamicModules(context, force=False):
assert tool._p_changed assert tool._p_changed
migrate = True migrate = True
for portal_id in ("portal_properties", "portal_uidannotation", for tool_id in ("portal_properties", "portal_uidannotation",
"portal_uidgenerator", "portal_uidhandler"): "portal_uidgenerator", "portal_uidhandler"):
if portal.hasObject(portal_id): if portal.hasObject(tool_id):
portal._delObject(portal_id, suppress_events=True) portal._delObject(tool_id, suppress_events=True)
migrate = True migrate = True
if tool_id == 'portal_properties':
portal.portal_skins.erp5_xhtml_style.breadcrumbs.write(
'return []')
if migrate: if migrate:
portal.migrateToPortalTypeClass() portal.migrateToPortalTypeClass()
......
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