

def handle(self, request, data):
    object_file = self.files['object_file']
    if data['path']:
        object_path = '/'.join([data['path'].rstrip('/'), data['name']])
    else:
        object_path = data['name']
    try:
        obj = api.swift.swift_upload_object(request, data['container_name'], object_path, object_file)
        messages.success(request, _('Object was successfully uploaded.'))
        return obj
    except Exception:
        exceptions.handle(request, _('Unable to upload object.'))

dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/containers/forms.py UploadObject.handle/original