Exemple #1
0
def create_user(
    screen_name='Faith',
    *,
    user_id=None,
    created_at=None,
    email_address=None,
    email_address_verified=False,
    initialized=True,
):
    if not user_id:
        user_id = generate_uuid()

    if not created_at:
        created_at = datetime.utcnow()

    if not email_address:
        email_address = f'user{user_id}@example.com'

    user = user_creation_service.build_user(created_at, screen_name,
                                            email_address)
    user.id = user_id
    user.email_address_verified = email_address_verified
    user.initialized = initialized

    return user
Exemple #2
0
def _create_user(screen_name, email_address):
    try:
        user = user_creation_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
Exemple #3
0
def create_user(screen_name='Faith', *, email_address=None, enabled=True):
    user_id = generate_uuid()

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

    user = user_creation_service.build_user(screen_name, email_address)
    user.id = user_id
    user.enabled = enabled

    return user
Exemple #4
0
def create_user(screen_name='Faith',
                *,
                user_id=None,
                created_at=None,
                email_address=None,
                enabled=True):
    if not user_id:
        user_id = generate_uuid()

    if not created_at:
        created_at = datetime.utcnow()

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

    user = user_creation_service.build_user(created_at, screen_name,
                                            email_address)
    user.id = user_id
    user.enabled = enabled

    return user
Exemple #5
0
def create_user(screen_name, email_address, *, enabled=False):
    user = user_creation_service.build_user(screen_name, email_address)
    user.enabled = enabled
    return user