'Updates a widget in a dashboard.
This method currently handles Text Box widgets only.
:param number widget_id: The ID of the widget to modify
:<json string text: The new contents of the text box'

@require_permission('edit_dashboard')
def post(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_properties = request.get_json(force=True)
    widget.text = widget_properties['text']
    models.db.session.commit()
    return widget.to_dict()
