Skip to content

Commit

Permalink
Refactor PostgresConnection to handle closed connections during query…
Browse files Browse the repository at this point in the history
… execution
  • Loading branch information
josephmancuso committed Oct 27, 2024
1 parent d28435b commit 9475b9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/masoniteorm/connections/PostgresConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def query(self, query, bindings=(), results="*"):
dict|None -- Returns a dictionary of results or None
"""
try:
if not hasattr(self, '_connection') or self._connection.closed:
if not self._connection or self._connection.closed:
self.make_connection()

self.set_cursor()
Expand Down

0 comments on commit 9475b9e

Please sign in to comment.