예제 #1
0
def get_username(strategy, details, user=None, *args, **kwargs):
    """
    Used in the pipeline of social auth.
    See: http://python-social-auth.readthedocs.org/en/latest/use_cases.html
    """
    result = social_get_username(strategy, details, user=user, *args, **kwargs)

    if details.get('email'):
        string = details.get('email')
    else:
        from random import random
        string = str(random())

    result['username'] = generate_unique_username(string)

    return result
예제 #2
0
def get_username(strategy, details, user=None, *args, **kwargs):
    result = social_get_username(strategy, details, user=user, *args, **kwargs)
    result['username'] = details['email']
    return result
예제 #3
0
파일: oauth.py 프로젝트: naitian/director
def get_username(strategy, details, user=None, *args, **kwargs):
    result = social_get_username(strategy, details, user=user, *args, **kwargs)
    return result
예제 #4
0
def get_username(strategy, details, user=None, *args, **kwargs):
    result = social_get_username(strategy, details, user=user, *args, **kwargs)
    result['username'] = str(result['username']).translate(None, " ?.!/;:")
    return result