fix add campaign

This commit is contained in:
Łukasz Jędyk 2022-05-17 19:19:47 +02:00
parent 5faadaa69b
commit 611f7a02d9

View File

@ -94,10 +94,6 @@ def add_twitter_campaign():
user_input = request_json['user_input'],
)
db.session.add(twitter_campaign)
db.session.flush()
db.session.refresh()
twitter_campaign_post = TwitterPost(
id = str(uuid4()),
campaign_id = twitter_campaign.id,
@ -106,6 +102,7 @@ def add_twitter_campaign():
twitter_post_id = response['id']
)
db.session.add(twitter_campaign)
db.session.add(twitter_campaign_post)
db.session.commit()