Permalink
Browse files

Take care to only delete cookie if user is present

  • Loading branch information...
1 parent f9f62e2 commit 37cba1ac03c2f3b155265e4bc5cb7a24e3100a1f @paltman paltman committed Jan 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 anafero/middleware.py
View
@@ -23,6 +23,6 @@ def process_request(self, request):
request.user._can_delete_anafero_cookie = True
def process_response(self, request, response):
- if getattr(request.user, "_can_delete_anafero_cookie", False):
+ if hasattr(request, "user") and getattr(request.user, "_can_delete_anafero_cookie", False):
response.delete_cookie("anafero-referral")
return response

0 comments on commit 37cba1a

Please sign in to comment.