diff --git a/src/api_service/mrna_service.py b/src/api_service/mrna_service.py index bd03e5f8..16a59f3d 100644 --- a/src/api_service/mrna_service.py +++ b/src/api_service/mrna_service.py @@ -1,6 +1,6 @@ import logging from json.decoder import JSONDecodeError -from typing import Any, Dict, Optional, Literal +from typing import Any, Dict, Optional, Literal, Union import requests from django.conf import settings from django.http import QueryDict @@ -35,7 +35,7 @@ def __get_service_content( url_prefix: str, method: Literal['get', 'post'], append_slash: bool - ) -> Optional[Any]: + ) -> Optional[Union[Dict, str]]: """ Generic function to make a request to a Modulector/BioAPI service @param service_name: Modulector/BioAPI service to consume @@ -66,9 +66,8 @@ def __get_service_content( logging.warning(f'{method.upper()} to {url} returned status_code {data.status_code} and ' f'message: {data.content}') return None - + content_type = data.headers.get('Content-Type', '') - print(content_type) if 'application/json' in content_type: return data.json() elif 'text/plain' in content_type or 'text/html' in content_type: diff --git a/src/molecules_details/urls.py b/src/molecules_details/urls.py index f84346fa..c3f3c3a6 100644 --- a/src/molecules_details/urls.py +++ b/src/molecules_details/urls.py @@ -15,6 +15,6 @@ path('gene-ontology-term-terms', views.GeneOntologyTermsOfTerm.as_view(), name='gene_ontology_term_terms'), path('actionable-cancer-genes', views.ActionableAndCancerGenes.as_view(), name='actionable_cancer_genes'), path('drugs-pharmgkb', views.DrugsPharmGKB.as_view(), name='drugs_pharmgkb'), - path('predicted-functiona-associations-network', views.PredictedFunctionalAssociationsNetwork.as_view(), name='predicted_functiona_associations_network'), + path('predicted-functional-associations-network', views.PredictedFunctionalAssociationsNetwork.as_view(), name='predicted_functional_associations_network'), path('drugs-regulating-gene', views.DrugsRegulatingGene.as_view(), name='drugs_regulating_gene') ] diff --git a/src/molecules_details/views.py b/src/molecules_details/views.py index 7351362a..78c64b13 100644 --- a/src/molecules_details/views.py +++ b/src/molecules_details/views.py @@ -342,8 +342,8 @@ class PredictedFunctionalAssociationsNetwork(APIView): """ Gets a list of genes and relations related to a gene. Examples: - http://localhost:8000/molecules/predicted-functiona-associations-network?gene=MX2&score=996 - http://localhost:8000/molecules/predicted-functiona-associations-network?gene=BRCA1&score=995 + http://localhost:8000/molecules/predicted-functional-associations-network?gene=MX2&score=996 + http://localhost:8000/molecules/predicted-functional-associations-network?gene=BRCA1&score=995 """ permission_classes = [permissions.IsAuthenticated] @@ -401,4 +401,3 @@ def get(request: HttpRequest): return Response({ 'data': data }) -