diff --git a/app.py b/app.py index b1bcb8d3f032be079f59e96145dfa1c021eea899..418ac75736ac461e03fe8c0f65834630b7aab1c1 100644 --- a/app.py +++ b/app.py @@ -476,7 +476,7 @@ def mastodon_oauthorized(): username = creds["username"] account_id = creds["id"] - bridge = db.session.query(Bridge).filter_by(mastodon_account_id=account_id, mastodon_host_id=masto_host.id).first() + bridge = db.session.query(Bridge).filter_by(mastodon_account_id=str(account_id), mastodon_host_id=masto_host.id).first() if bridge: session['bridge_id'] = bridge.id diff --git a/moa/tweet_poster.py b/moa/tweet_poster.py index b910bb01c2590cdd80fb55007434df5e6aeac48a..0f1f78a452a6746ab33bd7b38986f7ef09774782 100644 --- a/moa/tweet_poster.py +++ b/moa/tweet_poster.py @@ -60,7 +60,7 @@ class TweetPoster(Poster): # In the case where a toot has been broken into multiple tweets # we want the last one posted - mapping = self.session.query(Mapping).filter_by(mastodon_id=post.in_reply_to_id).order_by( + mapping = self.session.query(Mapping).filter_by(mastodon_id=str(post.in_reply_to_id)).order_by( Mapping.created.desc()).first() if mapping: diff --git a/moa/worker.py b/moa/worker.py index 733cb48b0499f2b1f5cd30742f67eb771f4e7ab2..dfd25d320ea9b45264db4a9bd2595dcfbf9832ff 100644 --- a/moa/worker.py +++ b/moa/worker.py @@ -136,7 +136,7 @@ bridges = session.query(Bridge).filter_by(enabled=True).filter(BridgeMetadata.wo l.info(f"Working on {bridges.count()} bridges") if 'sqlite' not in c.SQLALCHEMY_DATABASE_URI and not c.DEVELOPMENT: - bridges = bridges.order_by(func.rand()) + bridges = bridges.order_by(func.random()) bridge_count = 0