diff options
| author | Jason Pellerin <jpellerin@gmail.com> | 2006-11-28 15:48:39 +0000 |
|---|---|---|
| committer | Jason Pellerin <jpellerin@gmail.com> | 2006-11-28 15:48:39 +0000 |
| commit | e4e6bf0712fdd774e73bea7aadf799656544b513 (patch) | |
| tree | ce2a3071b4d143b984b7564fffdb888428621724 /django/db/backends/postgresql/base.py | |
| parent | 7e6d1365ba3c912b0582e291a5ae7d345f64abe3 (diff) | |
[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
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
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: |
