'Remove a widget from a dashboard.
:param number widget_id: ID of widget to remove
:>json array layout: New layout of dashboard this widget was removed from
:>json number version: Revision number of dashboard'

@require_permission('edit_dashboard')
def delete(self, widget_id):

    widget = models.Widget.get_by_id_and_org(widget_id, self.current_org)
    require_object_modify_permission(widget.dashboard, self.current_user)
    widget.delete()
    models.db.session.commit()
    return {'layout': widget.dashboard.layout, 'version': widget.dashboard.version}
