Bug 1018321 - Create url to one and done profile page based on username or name

Checking the path isn't a good idea in case you change the URL. Instead you should set a variable in the template context that this checks.