From e4e6bf0712fdd774e73bea7aadf799656544b513 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Tue, 28 Nov 2006 15:48:39 +0000 Subject: [multi-db] For all backends: commit only when a connection exists. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4127 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/postgresql/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/db/backends/postgresql') diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 774b52a1d6..cc6686ed81 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -43,7 +43,8 @@ class DatabaseWrapper(object): return cursor def _commit(self): - return self.connection.commit() + if self.connection: + return self.connection.commit() def _rollback(self): if self.connection: -- cgit v1.3