예제 #1
0
def lastuserauth():
    Profile.update_from_user(g.user,
                             db.session,
                             type_user=PROFILE_TYPE.PERSON,
                             type_org=PROFILE_TYPE.ORGANIZATION)
    db.session.commit()
    return redirect(get_next_url())
예제 #2
0
def lastuserauth():
    # Make profiles for the user's organizations
    username = g.user.username or g.user.userid
    profile = Profile.query.filter_by(userid=g.user.userid).first()
    if profile is None:
        profile = Profile(userid=g.user.userid,
                          name=g.user.username or g.user.userid,
                          title=g.user.fullname,
                          type=PROFILE_TYPE.PERSON)
        db.session.add(profile)
    else:
        if profile.name != username:
            profile.name = username
        if profile.title != g.user.fullname:
            profile.title = g.user.fullname
    for org in g.user.organizations_owned():
        profile = Profile.query.filter_by(userid=org['userid']).first()
        if profile is None:
            profile = Profile(userid=org['userid'],
                              name=org['name'],
                              title=org['title'],
                              type=PROFILE_TYPE.ORGANIZATION)
            db.session.add(profile)
        else:
            if profile.name != org['name']:
                profile.name = org['name']
            if profile.title != org['title']:
                profile.title = org['title']

    db.session.commit()
    return redirect(get_next_url())
예제 #3
0
파일: login.py 프로젝트: d1on/hacknight
def lastuserauth():
    # Make profiles for the user's organizations
    username = g.user.username or g.user.userid
    profile = Profile.query.filter_by(userid=g.user.userid).first()
    if profile is None:
        profile = Profile(userid=g.user.userid,
            name=g.user.username or g.user.userid,
            title=g.user.fullname,
            type=PROFILE_TYPE.PERSON)
        db.session.add(profile)
    else:
        if profile.name != username:
            profile.name = username
        if profile.title != g.user.fullname:
            profile.title = g.user.fullname
    for org in g.user.organizations_owned():
        profile = Profile.query.filter_by(userid=org['userid']).first()
        if profile is None:
            profile = Profile(userid=org['userid'],
                name=org['name'],
                title=org['title'],
                type=PROFILE_TYPE.ORGANIZATION)
            db.session.add(profile)
        else:
            if profile.name != org['name']:
                profile.name = org['name']
            if profile.title != org['title']:
                profile.title = org['title']

    db.session.commit()
    return redirect(get_next_url())
예제 #4
0
def lastusernotify(user):
    Profile.update_from_user(user,
                             db.session,
                             type_user=PROFILE_TYPE.PERSON,
                             type_org=PROFILE_TYPE.ORGANIZATION)
    db.session.commit()
예제 #5
0
def lastusernotify(user):
    Profile.update_from_user(user, db.session, type_user=PROFILE_TYPE.PERSON, type_org=PROFILE_TYPE.ORGANIZATION)
    db.session.commit()
예제 #6
0
def lastuserauth():
    Profile.update_from_user(g.user, db.session, type_user=PROFILE_TYPE.PERSON, type_org=PROFILE_TYPE.ORGANIZATION)
    db.session.commit()
    return redirect(get_next_url())