alphagov/specialist-publisher — pull request #146 by kalleth (2014-06-27 10:42:43+00:00)
Title: Update panopticon when updating a case title

([Trello ticket](https://trello.com/c/phpPdi6D/172-bug-trying-to-publish-this-case-get-s-a-slug-already-taken-error))

When a user created a draft case, then changed the title of that draft
case, specialist-publisher's panopticon mappings would get out of date
with Panopticon as we'd send Panopticon a create for the new slug rather
than issuing an update for the existing mapping.

This resulted in a 500 error when publishing the case as Panopticon
would report the slug had already been taken.

By ensuring PanopticonMapping is kept up to date when a slug change
happens (by finding the existing mapping searching by resource ID, not
slug) we prevent this case.

In order to find the mapping by resource ID, we need to ensure that only
one mapping is described by one resource ID, therefore for
ManualChangeNotes, we generate a unique resource_id by building it from
the parent.

[+ @bestie]