# HG changeset patch # User Brian Neal # Date 1352936821 21600 # Node ID 63603e9315038eb6046923c081d8847059c133cb # Parent f4c043cf55ac29d11d4e2f48a6b7141a02fe61f9 Fix bug; user_logged_out signal can be sent with user is None. diff -r f4c043cf55ac -r 63603e931503 wiki/signals.py --- a/wiki/signals.py Tue Nov 13 13:50:06 2012 -0600 +++ b/wiki/signals.py Wed Nov 14 17:47:01 2012 -0600 @@ -34,11 +34,12 @@ object so that the response middleware can delete the wiki's cookie. """ - logger.info('User logout: %s', user.username) + if user: + logger.info('User logout: %s', user.username) - # Remember what Redis set member to delete by adding an attribute to the - # request object: - request.wiki_delete_cookie = request.session.get(SESSION_SET_MEMBER) + # Remember what Redis set member to delete by adding an attribute to the + # request object: + request.wiki_delete_cookie = request.session.get(SESSION_SET_MEMBER) user_logged_in.connect(login_callback, dispatch_uid='wiki.signals.login')