diff --git a/app/crud/projects_crud.py b/app/crud/projects_crud.py index 90203043..4d6c9fa0 100644 --- a/app/crud/projects_crud.py +++ b/app/crud/projects_crud.py @@ -208,45 +208,6 @@ def update_translation_project(db_:Session, project_obj, project_id, user_id=Non db_.refresh(project_row) return project_row -# def update_translation_project(db_:Session, project_obj, project_id, user_id=None): -# '''Either activate or deactivate a project or Add more books to a project, -# adding all new verses to the drafts table''' -# project_row = db_.query(db_models.TranslationProject).get(project_id) -# if not project_row: -# raise NotAvailableException(f"Project with id, {project_id}, not found") -# new_books = [] -# if project_obj.sentenceList: -# update_translation_project_sentences(db_, project_obj,project_id, new_books, user_id) -# if project_obj.uploadedUSFMs: -# #uploaded usfm book add to project -# update_translation_project_uploaded_book(db_,project_obj,project_id,new_books,user_id) -# # db_.commit() -# # db_.expire_all() -# if project_obj.projectName: -# project_row.projectName = project_obj.projectName -# if project_obj.active is not None: -# project_row.active = project_obj.active -# if project_obj.useDataForLearning is not None: -# project_row.metaData['useDataForLearning'] = project_obj.useDataForLearning -# flag_modified(project_row, "metaData") -# if project_obj.stopwords: -# project_row.metaData['stopwords'] = project_obj.stopwords.__dict__ -# flag_modified(project_row, "metaData") -# if project_obj.punctuations: -# project_row.metaData['punctuations'] = project_obj.punctuations -# flag_modified(project_row, "metaData") -# if project_obj.compatibleWith: -# project_row.compatibleWith= project_obj.compatibleWith -# project_row.updatedUser = user_id - -# if len(new_books) > 0: -# project_row.metaData['books'] += new_books -# flag_modified(project_row, "metaData") -# db_.add(project_row) -# db_.commit() -# db_.refresh(project_row) -# return project_row - # pylint: disable=duplicate-code diff --git a/app/crud/utils.py b/app/crud/utils.py index 0f97f52b..7ed7c047 100644 --- a/app/crud/utils.py +++ b/app/crud/utils.py @@ -6,7 +6,6 @@ from sqlalchemy.orm import Session import db_models from custom_exceptions import UnprocessableException -# from usfm_grammar import USFMParser, Filter #pylint: disable=R1732,C0303 def normalize_unicode(text, form="NFKC"): '''to normalize text contents before adding them to DB''' @@ -254,24 +253,3 @@ def create_decimal_ref_id(db_:Session, bookcode, chapter, verse): ref_id = (book_id * 100000) + (chapter * 1000) + verse return ref_id raise ValueError("book_id, chapter, and verse must not be None.") - - -# def parse_usfm(usfm_string): -# '''parse an uploaded usfm file using usfm-grammar''' -# try: -# usfm_parser = USFMParser(normalize_unicode(usfm_string)) - -# usfm_json = usfm_parser.to_usj(include_markers=Filter.BCV+Filter.TEXT) -# except Exception as exce: -# raise TypeException("Errors in input USFM") from exce - -# return usfm_json - -# def form_usfm(usj_obj): -# '''convert a usfm-grammar format JSON into usfm''' -# try: -# usj_parser = USFMParser(from_usj=usj_obj) -# usfm_string = usj_parser.usfm -# except Exception as exce: -# raise TypeException("Errors in input USJ(USFM JSON)") from exce -# return usfm_string diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 234850cc..2a47c829 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,7 +3,7 @@ services: kratos-postgresd: image: postgres:9.6 ports: - - "7008:5432" + - "5432:5432" expose: - 5432 restart: always @@ -46,8 +46,8 @@ services: kratos: image: oryd/kratos:v1.0.0 ports: - - '4435:4433' # public - # - '4434:4434' # admin + - '4433:4433' # public + # -'4434:4434' # admin restart: unless-stopped environment: - DSN=${VACHAN_AUTH_DATABASE:-postgres://kratos:secret@kratos-postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4} @@ -71,12 +71,12 @@ services: - VE-network vachan-db: - image: postgres:15.3 + image: postgres:16.0 healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ] timeout: 45s interval: 10s - retries: 3 + retries: 10 restart: always environment: - POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} @@ -91,7 +91,7 @@ services: - 5432 ports: # HOST:CONTAINER - - "7777:5432" + - "5433:5432" networks: - VE-network volumes: @@ -237,6 +237,8 @@ services: vachan-cms-graphql: image: athulyams/graphql-12:v2.0.0-alpha.1 + ports: + - "8004:8004" expose: - 8004 command: uvicorn main:app --host 0.0.0.0 --port 8004 @@ -404,4 +406,4 @@ volumes: logs-test-vol: vachan-db-backup: kratos-db-backup: - vachan-tbt-ml-models-vol: + vachan-tbt-ml-models-vol: \ No newline at end of file