twitter #2

Merged
s434708 merged 50 commits from twitter into master 2022-06-09 19:42:33 +02:00
Showing only changes of commit 2458cff797 - Show all commits

View File

@ -147,12 +147,11 @@ def get_twitter_campaign_details():
if content_type != 'application/json': if content_type != 'application/json':
return "Content-type not supported!", 400 return "Content-type not supported!", 400
request_json = request.json if 'campaign_id' not in request.headers:
if 'campaign_id' not in request_json:
return "Invalid request!", 400 return "Invalid request!", 400
twitter_campaign = TwitterCampaign.query.filter_by(user_id=user_id, id=request_json['campaign_id']).first() twitter_campaign = TwitterCampaign.query.filter_by(user_id=user_id, id=request.headers['campaign_id']).first()
campaign_posts = TwitterPost.query.filter_by(user_id=user_id, campaign_id=request_json['campaign_id']).all() campaign_posts = TwitterPost.query.filter_by(user_id=user_id, campaign_id=request.headers['campaign_id']).all()
posts = [] posts = []
for post in campaign_posts: for post in campaign_posts: