Skip to content

Commit

Permalink
Merge pull request #48 from crgwbr/fix_missing_user_attribute
Browse files Browse the repository at this point in the history
Fix missing attribute request.user on redirect responses
  • Loading branch information
specialunderwear committed Dec 22, 2015
2 parents 3492c99 + 95a1d2f commit 1f77153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oscarapi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def process_request(self, request):
store_basket_in_session(basket, request.session)

def process_response(self, request, response):
if self.is_api_request(request):
if self.is_api_request(request) and hasattr(request, 'user'):
# at this point we are sure a basket can be found in the session,
# because it is enforced in process_request.
# We just have to make sure it is stored as a cookie, because it
Expand Down

0 comments on commit 1f77153

Please sign in to comment.