Permalink
Browse files

Check to see if the db is closed before attempting to close, fixes #65

🐵
  • Loading branch information...
1 parent 3e81953 commit 76576fda6c05e71e1a28727cf40c51b6a603e4c3 @coleifer committed Feb 2, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 flask_peewee/db.py
View
@@ -45,7 +45,8 @@ def connect_db(self):
self.database.connect()
def close_db(self, exc):
- self.database.close()
+ if not self.database.is_closed():
+ self.database.close()
def register_handlers(self):
self.app.before_request(self.connect_db)

0 comments on commit 76576fd

Please sign in to comment.