bread-and-pepper/django-userena — pull request #228 by gegenschall (2012-08-23 13:23:11+00:00)
Title: Use the django-guardian permission_required_or_404 decorator for profile_detail view

Use the ```permission_required_or_404``` decorator to restrict access to the ```profile_detail``` view. There are actually checks inside the view to restrict access to profiles. But accessing your own profile while being not logged in does result in the string "You don't have permission to access the profile" being displayed and the user being forced to press the back button and login "manually".
Adding the decorator to the view leaves the possibility to redirect the user back to the login page by configuring django-guardian accordingly.