alphagov/stagecraft — pull request #216 by roc (2014-09-11 09:40:00+00:00)
Title: [#75970986] Update dashboard via `PUT`

See: https://www.pivotaltracker.com/story/show/75970986

# Don't get sidetracked by verbs

The pattern has changed a bit now, but looks something like:
- To create a dashboard, `POST` to it without a resource id
- To edit it, send a `PUT` request, complete with a resource id

Innovations towards progress:
- `get_object_or_404` the dashboard you're attempting to update when you send a dashboard id
- `@require_http_methods(['POST', 'PUT'])` around the dashboard method to be a bit more explicit about what kind of things we expect in the `view` (*vis.* API controller)
- Adds a new route in `urls.py` for `dashboard/dashboard_id` so we can update pre-existing dashboards