Skip to content

Commit

Permalink
Slightly changed bind logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Mar 18, 2011
1 parent 5fe01a4 commit 4f8e2b1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions flaskext/sqlalchemy.py
Expand Up @@ -190,11 +190,8 @@ def __init__(self, db, autocommit=False, autoflush=False, **options):
self._model_changes = {}

def get_bind(self, mapper, clause=None):
try:
bind_key = mapper and mapper.mapped_table.info.get('bind_key') \
or None
except AttributeError:
bind_key = None
info = getattr(mapper.mapped_table, 'info', {})
bind_key = info.get('bind_key')

if bind_key is not None:
state = get_state(self.app)
Expand Down

0 comments on commit 4f8e2b1

Please sign in to comment.