'Modifies a dashboard.
:qparam string slug: Slug of dashboard to retrieve.
Responds with the updated :ref:`dashboard <dashboard-response-label>`.
:status 200: success
:status 409: Version conflict -- dashboard modified since last read'

@require_permission('edit_dashboard')
def post(self, dashboard_slug):

    dashboard_properties = request.get_json(force=True)
    dashboard = models.Dashboard.get_by_id_and_org(dashboard_slug, self.current_org)
    require_object_modify_permission(dashboard, self.current_user)
    updates = project(dashboard_properties, ('name', 'layout', 'version', 'is_draft', 'dashboard_filters_enabled'))
    if (('version' in updates) and (updates['version'] != dashboard.version)):
        abort(409)
    updates['changed_by'] = self.current_user
    self.update_model(dashboard, updates)
    models.db.session.add(dashboard)
    try:
        models.db.session.commit()
    except StaleDataError:
        abort(409)
    result = dashboard.to_dict(with_widgets=True, user=self.current_user)
    return result
