Skip to content

Commit

Permalink
Merge pull request #313 from bjersey/feature/fix-search-path-in-rollback
Browse files Browse the repository at this point in the history
must set search_path again after a transaction rollback
  • Loading branch information
bernardopires committed Dec 25, 2015
2 parents 376746f + 94d325b commit 3c368ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tenant_schemas/postgresql_backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def close(self):
self.search_path_set = False
super(DatabaseWrapper, self).close()

def rollback(self):
super(DatabaseWrapper, self).rollback()
# Django's rollback clears the search path so we have to set it again the next time.
self.search_path_set = False

def set_tenant(self, tenant, include_public=True):
"""
Main API method to current database schema,
Expand Down

0 comments on commit 3c368ab

Please sign in to comment.