Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
persist the user's language in the API for SharedSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Aug 1, 2013
1 parent 35d3077 commit 9dc29af
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mkt/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ def is_authenticated(self, request, **kwargs):
except UserProfile.DoesNotExist:
log.info('Auth token matches absent user (%s)' % email)
return False

# Persist the user's language.
if (getattr(request, 'amo_user', None)
and request.amo_user.lang != request.LANG):
request.amo_user.lang = request.LANG
request.amo_user.save()

ACLMiddleware().process_request(request)
else:
log.info('Shared-secret auth token does not match')
Expand Down

0 comments on commit 9dc29af

Please sign in to comment.