Skip to content

Commit

Permalink
#11: Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jun 21, 2019
1 parent 2cfd027 commit 463ebf8
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,6 @@
from common.exceptions import MissingRecordError, BadFilterError, BadRequestError


def get_record_by_id(table, id):
"""
Gets a row from the dummy data credential database
:param table: the table class mapping
:param id: the id to find
:return: the row from the table
"""
session = get_db_session()
result = session.query(table).filter(table.ID == id).first()
if result is not None:
session.close()
return result
session.close()
raise MissingRecordError()


def get_db_session():
"""
Gets a session in the dummy data database, currently used for credentials until Authentication is understood
:return: the dummy data DB session
"""
engine = create_engine("mysql+pymysql://root:root@localhost:3306/icatdummy")
Session = sessionmaker(bind=engine)
session = Session()
return session


def get_icat_db_session():
Expand Down

0 comments on commit 463ebf8

Please sign in to comment.