Skip to content
Snippets Groups Projects
Commit 7bc1c432 authored by martin.zumr's avatar martin.zumr
Browse files

[FIX] use python request instead of urllib

parent bb929604
No related branches found
No related tags found
3 merge requests!607Pirati.cz,!592[ADD] update_articles command,!575Feature/pirati cz
Pipeline #9475 passed
...@@ -2,7 +2,7 @@ import json ...@@ -2,7 +2,7 @@ import json
import logging import logging
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import urllib3 import requests
from article_import_utils.utils import create_image_from_url from article_import_utils.utils import create_image_from_url
from main.models import MainArticlePage, MainArticlesPage, ARTICLE_TYPES from main.models import MainArticlePage, MainArticlesPage, ARTICLE_TYPES
...@@ -21,8 +21,8 @@ class ArticleDownloadService: ...@@ -21,8 +21,8 @@ class ArticleDownloadService:
return MainArticlePage.objects.filter(article_type=ARTICLE_TYPES.WORK_TIMELINE).values_list('slug', flat=True) return MainArticlePage.objects.filter(article_type=ARTICLE_TYPES.WORK_TIMELINE).values_list('slug', flat=True)
def get_articles_response(self): def get_articles_response(self):
response = urllib3.PoolManager().request('GET', self.api_url) response = requests.get(self.api_url)
data = json.loads(response.data) data = json.loads(response.text)
return data return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment