Catch when a users codename contains invalid characters
Standardise flash message about unknown codenames
Merge pull request #563 from DonnchaC/invalid_codename_handling

Catch when a user's codename contains invalid characters. Fixes #548