Skip to content

Commit

Permalink
safer safe keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Jenkins committed May 3, 2012
1 parent 9152d83 commit 674d474
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mongoalchemy/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, database, safe=False):
self.safe = safe

@classmethod
def connect(self, database, safe=False, *args, **kwds):
def connect(self, database, *args, **kwds):
''' `connect` is a thin wrapper around __init__ which creates the
database connection that the session will use.
Expand All @@ -80,6 +80,9 @@ def connect(self, database, safe=False, *args, **kwds):
:param args: arguments for :class:`pymongo.connection.Connection`
:param kwds: keyword arguments for :class:`pymongo.connection.Connection`
'''
safe = kwds.get('safe', False)
if 'safe' in kwds:
del kwds['safe']
conn = Connection(*args, **kwds)
db = conn[database]
return Session(db, safe=safe)
Expand Down

0 comments on commit 674d474

Please sign in to comment.