okfn/ckan — pull request #178 by seanh (2012-11-20 13:56:27+00:00)
Title: Fix a crash in dashboard_activity_list auth

Fix the dashboard_activity_list auth function to not crash when no user is logged in, and add some tests for this case.

This was crashing when context['user'] was None, fix it to give a 403 instead.

According to [a comment in the code](https://github.com/okfn/ckan/blob/master/ckan/lib/base.py#L229) you either get the user name in context['user'] and a matching user object in context['userobj'], or you get None in both.

I don't know if the comment is really true or not but assuming it is then `if context.get('user')` should be sufficient to check whether someone is logged in.