Skip to content

Commit

Permalink
cleanup: db and exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-Joseph-George committed Mar 21, 2024
1 parent e1485de commit ac055d9
Show file tree
Hide file tree
Showing 25 changed files with 4 additions and 60,322 deletions.
20 changes: 0 additions & 20 deletions app/custom_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ def __init__(self, detail: str):
self.detail = detail
self.status_code = 500

class DatabaseException(Exception):
'''Format for Database error'''
def __init__(self, detail):
super().__init__()
self.name = "Database Error"
self.logging_info = detail.__dict__
if 'orig' in detail.__dict__:
self.detail = str(detail.__dict__['orig']).replace('DETAIL:','')
else:
self.detail = str(detail)
self.status_code = 502

class AuthException(Exception):
'''Format for Gitlab error in media access APIs'''
def __init__(self, detail):
super().__init__()
self.name = "Kratos Access Error"
self.detail = detail
self.status_code = 502

class GitlabException(Exception):
'''Format for Gitlab error in media access APIs'''
def __init__(self, detail):
Expand Down
3 changes: 2 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
UnprocessableException,NotAvailableException, AlreadyExistsException,\
UnAuthorizedException, GitlabException
import db_models
from database import engine
from dependencies import get_db, log
# pylint: enable=E0401
root_url = os.getenv("VACHAN_DOMAIN", 'http://localhost:8000')
Expand Down Expand Up @@ -203,7 +204,7 @@ async def gitlab_exception_handler(request, exc: GitlabException):
)
######################################################
# db_models.map_all_dynamic_tables(db_= next(get_db()))
# db_models.Base.metadata.create_all(bind=engine)
db_models.Base.metadata.create_all(bind=engine)


@app.get('/', response_class=HTMLResponse, status_code=200)
Expand Down
Binary file removed db/AgMT tables.png
Binary file not shown.
Binary file removed db/Version 2 DB Schema.png
Binary file not shown.
Binary file removed db/Version 2 DB Schema_old.png
Binary file not shown.
67 changes: 0 additions & 67 deletions db/csvs/bible_books.csv

This file was deleted.

10,455 changes: 0 additions & 10,455 deletions db/csvs/consolidated_languages.csv

This file was deleted.

8 changes: 0 additions & 8 deletions db/csvs/licenses.csv

This file was deleted.

36 changes: 0 additions & 36 deletions db/csvs/stop_words/assamese.csv

This file was deleted.

29 changes: 0 additions & 29 deletions db/csvs/stop_words/bengali.csv

This file was deleted.

47 changes: 0 additions & 47 deletions db/csvs/stop_words/gujarati.csv

This file was deleted.

54 changes: 0 additions & 54 deletions db/csvs/stop_words/hindi.csv

This file was deleted.

44 changes: 0 additions & 44 deletions db/csvs/stop_words/kannada.csv

This file was deleted.

71 changes: 0 additions & 71 deletions db/csvs/stop_words/malayalam.csv

This file was deleted.

Loading

0 comments on commit ac055d9

Please sign in to comment.