Skip to content

Commit

Permalink
fixing db user issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TransformerOptimus committed Jun 7, 2023
1 parent 6e95abb commit d70fcd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superagi/controllers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def create_user(user: sqlalchemy_to_pydantic(User, exclude=["id"]),
db_user = User(name=user.name, email=user.email, password=user.password, organisation_id=user.organisation_id)
db.session.add(db_user)
db.session.commit()
organisation = Organisation.find_or_create_organisation(db.session, user)
db.session.flush()
organisation = Organisation.find_or_create_organisation(db.session, db_user)
Project.find_or_create_default_project(db.session, organisation.id)
print("User created", db_user)
return db_user
Expand Down

0 comments on commit d70fcd0

Please sign in to comment.