Skip to content

Commit

Permalink
Resolve 'no transaction is begun' error when invoking tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
askz committed Oct 6, 2017
1 parent 590d919 commit ab60871
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasks/app/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def create_user(
)

from app.extensions import db
db.session.begin()
db.session.add(new_user)
db.session.commit()

Expand Down Expand Up @@ -68,5 +69,6 @@ def create_oauth2_client(
)

from app.extensions import db
db.session.begin()
db.session.add(oauth2_client)
db.session.commit()

0 comments on commit ab60871

Please sign in to comment.