From 69abe3f6e68d2e80b047554b4ed97c8582cbfa7c Mon Sep 17 00:00:00 2001 From: flifloo Date: Tue, 30 Apr 2019 19:53:01 +0200 Subject: [PATCH] Background color, spelling, Trello login, trello board ans tweets fix --- app/routes.py | 8 +++++--- app/templates/index.html | 2 +- app/templates/template.html | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/routes.py b/app/routes.py index e332939..a2d274f 100644 --- a/app/routes.py +++ b/app/routes.py @@ -69,7 +69,7 @@ def twlogout(): @app.route("/trlogin") @login_required def trlogin(): - if current_user.twitter_api.first(): + if current_user.trello_api.first(): return "Already an api connected." return redirect(f"https://trello.com/1/authorize?expiration=never&name=Cyberplanificateur&scope=read,write&response_type=token&key={trello_credentials.api_key}&return_url=https://cyberplanificateur.flifloo.fr/settings") @@ -138,8 +138,10 @@ def dashboard(): keywords += f" {text} |" tweets.append({"text": statu.text, "id": t.statu_id, "slots": f"{t.slots}/{t.slots_max}", "keywords": keywords}) - for t in twapi.user_timeline(): + for t in twapi.user_timeline(count = 200): if not t.in_reply_to_status_id and not t.retweeted and not Tweets.query.filter_by(user = current_user, statu_id = t.id).first(): + if len(timeline) >= 5: + break timeline.append({"text": t.text, "id": t.id}) @@ -147,7 +149,7 @@ def dashboard(): trapi = trapi.api_login() for b in trapi.list_boards(): select = False - if b.id == current_user.boards.first().board_id: + if current_user.boards.first() and b.id == current_user.boards.first().board_id: select = True boards.append({"text": b.name, "id": b.id, "select": select}) diff --git a/app/templates/index.html b/app/templates/index.html index 8003fad..22be2db 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -5,7 +5,7 @@