Skip to content

Commit

Permalink
update the slugify to python-slugify
Browse files Browse the repository at this point in the history
  • Loading branch information
Q-Niranjan committed Nov 11, 2024
1 parent 7c9700d commit caedf09
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"openg2p-fastapi-common",
"openg2p-fastapi-auth",
"boto3",
"slugify",
"python-slugify>=8.0.0",
]
dynamic = ["version"]

Expand Down
4 changes: 2 additions & 2 deletions src/openg2p_portal_api/services/document_file_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from openg2p_fastapi_common.context import dbengine
from openg2p_fastapi_common.errors.http_exceptions import BadRequestError
from openg2p_fastapi_common.service import BaseService
from slugify import slugify
from slugify import slugify as python_slugify
from sqlalchemy import select
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.asyncio import async_sessionmaker
Expand Down Expand Up @@ -102,7 +102,7 @@ async def upload_document(self, file, programid: int, file_tag: str):
await session.refresh(new_file)

# Generate slugified filename
slugified_filename = slugify(name)
slugified_filename = python_slugify(name)
file_id = await get_file_id_by_slug(self)
final_filename = f"{slugified_filename}-{file_id}"

Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pytest-cov
pytest-asyncio
pytest
pytest-mock
python-slugify>=8.0.0
git+https://github.com/openg2p/openg2p-fastapi-common@develop#subdirectory=openg2p-fastapi-common
git+https://github.com/openg2p/openg2p-fastapi-common@develop#subdirectory=openg2p-fastapi-auth
2 changes: 1 addition & 1 deletion tests/test_partner_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
VALID_ID_TYPE_CONFIG = {
"g2p_id_type": "national_id",
"company_id": 1,
"token_map": "name:name email:email gender:gender birthdate:birthdate phone:phone",
"token_map": "name:name email:email gender:gender birthdate:birthdate phone:phone user_id:user_id",
"date_format": "%Y/%m/%d",
}

Expand Down

0 comments on commit caedf09

Please sign in to comment.