示例#1
0
def add_default_users(db):
    try:
        UserRole.add_default_roles()
        User.add_default_users()
    except sqlalchemy.exc.IntegrityError as e:
        db.session.rollback()
        print(e)
示例#2
0
def add_default_users(db):
    UserRole.add_default_roles()
    db.session.flush()
    User.add_default_users()