alphagov/govuk_content_models — pull request #149 by JordanHatch (2014-03-27 10:58:35+00:00)
Title: Improve validations for tags

Relates to https://www.pivotaltracker.com/story/show/66501256

As we are adding the ability for certain types of tags to be created in Panopticon, there is a need to add additional validation to tags to make sure Tag IDs for newly-created tags are broadly sensible.

This adds a new validator for Tags, which checks that the Tag IDs conform to the following:
- Only contain lowercase alphanumeric characters and dashes.
- Only one slash is permitted in the tag

This also includes a uniqueness validation, to complement the existing unique index on Tag IDs and Tag Types.

I'd consider this a breaking change, as existing apps might rely on the lack of validation here in their tests.