コード例 #1
0
def get_minimal_session(db, user):
    session = SessionSubFactory(
        subtitle=None,
        level=None,
        language=None,
        short_abstract=None,
        slides_url=None,
        state=None,
        is_locked=False,
        creator_id=user.id,
    )
    SpeakersCallSubFactory(event=session.event)
    db.session.commit()

    return session
コード例 #2
0
def get_session(db, user, event_owner=True, **kwargs):
    new_user = UserFactory(is_admin=False, is_verified=False)

    if event_owner:
        owner = user
        creator = new_user
    else:
        owner = new_user
        creator = user
    session = SessionSubFactory(creator_id=creator.id, **kwargs)
    role, _ = get_or_create(Role, name='owner', title_name='Owner')
    UsersEventsRoles(user=owner, event=session.event, role=role)
    SpeakersCallSubFactory(event=session.event)
    db.session.commit()

    return session
コード例 #3
0
def get_minimal_speaker(db, user, organizer=False):
    speaker = SpeakerSubFactory(
        gender=None,
        mobile=None,
        organisation=None,
        position=None,
        short_biography=None,
        speaking_experience=None,
        city=None,
        heard_from=None,
        email=user.email,
        user=user,
        event=get_event(db, user if organizer else None),
    )
    SpeakersCallSubFactory(event=speaker.event)
    db.session.commit()

    return speaker
コード例 #4
0
def get_minimal_speaker(db, user):
    speaker = SpeakerSubFactory(
        gender=None,
        mobile=None,
        organisation=None,
        position=None,
        short_biography=None,
        speaking_experience=None,
        city=None,
        heard_from=None,
        email=user._email,
        user=user,
        event__state='published',
    )
    SpeakersCallSubFactory(event=speaker.event)
    db.session.commit()

    return speaker