@intercept_errors(UserAPIInternalError, ignore_errors=[UserAPIRequestError])
def get_user_preferences(requesting_user, username=None):
 existing_user = _get_authorized_user(requesting_user, username, allow_staff=True)
 context = {'request': get_request_or_stub()}
 user_serializer = UserSerializer(existing_user, context=context)
 return user_serializer.data['preferences']

@ intercept_errors ( UserAPIInternalError , ignore_errors = [ UserAPIRequestError ] ) def get_user_preferences ( requesting_user , username = None ) : existing_user = _get_authorized_user ( requesting_user , username , allow_staff = True ) context = { 'request' : get_request_or_stub ( ) } user_serializer = UserSerializer ( existing_user , context = context ) return user_serializer . data [ 'preferences' ]
returns all user preferences as a json response .