fix person url
This commit is contained in:
@@ -18,12 +18,12 @@ import httpx
|
|||||||
class MedicalCardService(BaseService[models.MedicalCard, MedicalCardCreateIn, Any]):
|
class MedicalCardService(BaseService[models.MedicalCard, MedicalCardCreateIn, Any]):
|
||||||
def __init__(self, db_session: Session):
|
def __init__(self, db_session: Session):
|
||||||
super(MedicalCardService, self).__init__(models.MedicalCard, db_session)
|
super(MedicalCardService, self).__init__(models.MedicalCard, db_session)
|
||||||
LOCAL_PERSONAL_INFO_URL = 'http://localhost:8001/persons'
|
LOCAL_PERSONAL_INFO_URL = 'http://localhost:8001'
|
||||||
self.PERSONAL_INFO_URL = os.environ.get('ASTRA-PESONAL-INFORMATION') or LOCAL_PERSONAL_INFO_URL
|
self.PERSONAL_INFO_URL = os.environ.get('ASTRA-PESONAL-INFORMATION') or LOCAL_PERSONAL_INFO_URL
|
||||||
|
|
||||||
def get_persons(self, searchstring: str) -> List[PersonOut]:
|
def get_persons(self, searchstring: str) -> List[PersonOut]:
|
||||||
try:
|
try:
|
||||||
response = httpx.get(f'{self.PERSONAL_INFO_URL}/?full_name={searchstring}')
|
response = httpx.get(f'{self.PERSONAL_INFO_URL}/persons/?full_name={searchstring}')
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except httpx.RequestError as exc:
|
except httpx.RequestError as exc:
|
||||||
print(f"Ошибка вызова {exc.request.url!r}.")
|
print(f"Ошибка вызова {exc.request.url!r}.")
|
||||||
|
|||||||
Reference in New Issue
Block a user