Skip to content

Commit

Permalink
fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsyedomair committed Oct 7, 2024
1 parent 04f158f commit bc39551
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Backend/postgres_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import psycopg2.extras
from config import load_config


# important do not store password when dealing with real database
# might want to consider SQL injection down the line
# gets all systems from the database
Expand All @@ -20,13 +19,15 @@ class PostgresConnector:
connection: A psycopg2 connection object to interact with the database.
"""
def __init__(self):
self.connection = psycopg2.connect(
host='localhost',
dbname='dad',
user='dad_user',
password='dad_pass',
port='5432'
)
config = load_config()
try:
# connecting to the PostgreSQL server
self.connection = psycopg2.connect(**config)
print('Connected to the PostgreSQL server.')

except (psycopg2.DatabaseError, Exception) as error:
print(error)


def construct_label(self, data):
return (
Expand Down

0 comments on commit bc39551

Please sign in to comment.