diff --git a/synapse/storage/databases/main/media_repository.py b/synapse/storage/databases/main/media_repository.py index c2285faf7630..ad2056d6b29d 100644 --- a/synapse/storage/databases/main/media_repository.py +++ b/synapse/storage/databases/main/media_repository.py @@ -418,13 +418,13 @@ async def count_pending_media(self, user_id: UserID) -> Tuple[int, int]: """ def get_pending_media_txn(txn: LoggingTransaction) -> Tuple[int, int]: - sql = ( - "SELECT COUNT(*), MIN(created_at)" - " FROM local_media_repository" - " WHERE user_id = ?" - " AND created_at > ?" - " AND media_length IS NULL" - ) + sql = """ + SELECT COUNT(*), MIN(created_at) + FROM local_media_repository + WHERE user_id = ? + AND created_at > ? + AND media_length IS NULL + """ txn.execute( sql, (