示例#1
0
def _create_user(screen_name, email_address):
    try:
        user = user_service.build_user(screen_name, email_address)
    except ValueError as e:
        raise click.UsageError(e)

    user.enabled = True
    db.session.add(user)
    db.session.commit()

    return user
def _create_user(screen_name, email_address):
    try:
        user = user_service.build_user(screen_name, email_address)
    except ValueError as e:
        raise click.UsageError(e)

    user.enabled = True
    db.session.add(user)
    db.session.commit()

    return user
示例#3
0
def create_user(number, *, screen_name=None, email_address=None, enabled=True):
    if not screen_name:
        screen_name = 'User-{:d}'.format(number)

    if not email_address:
        email_address = 'user{:03d}@example.com'.format(number)

    user = user_service.build_user(screen_name, email_address)
    user.id = generate_uuid()
    user.enabled = enabled
    return user
示例#4
0
def create_user(number, *, screen_name=None, email_address=None, enabled=True):
    if not screen_name:
        screen_name = 'User-{:d}'.format(number)

    if not email_address:
        email_address = 'user{:03d}@example.com'.format(number)

    user = user_service.build_user(screen_name, email_address)
    user.id = generate_uuid()
    user.enabled = enabled
    return user
示例#5
0
def create_user(screen_name, email_address, *, enabled=False):
    user = user_service.build_user(screen_name, email_address)
    user.enabled = enabled
    return user