'Return the locale for the users based on their preferences.
Does not return a value if the users have not set their locale preferences.'

def claim_locale(self, data):

    language = UserPreference.get_value(data['user'], LANGUAGE_KEY)
    if (not language):
        language = settings.LANGUAGE_CODE
    return language
