'Gets the user preference value for a given key.
Note:
This method provides no authorization of access to the user preference.
Consider using user_api.preferences.api.get_user_preference instead if
this is part of a REST API request.
Arguments:
user (User): The user whose preference should be set.
preference_key (str): The key for the user preference.
default: The object to return if user does not have preference key set
Returns:
The user preference value, or default if one is not set.'

@classmethod
def get_value(cls, user, preference_key, default=None):

    try:
        user_preference = cls.objects.get(user=user, key=preference_key)
        return user_preference.value
    except cls.DoesNotExist:
        return default
