Do not set transaction as readonly with psycopg2cffi

issue9546
review294341002
This commit is contained in:
Cédric Krier committed 2020-08-29 18:23:26 +02:00
1 parent db6cc1324d
commit 261c7b0a52
1 file changed
+1 -1
+1 -1
View File
@@ -231,7 +231,7 @@ class Database(DatabaseInterface):
# psycopg2cffi does not have the readonly property
if hasattr(conn, 'readonly'):
conn.readonly = readonly
elif not autocommit:
elif not autocommit and readonly:
cursor = conn.cursor()
cursor.execute('SET TRANSACTION READ ONLY')
return conn