Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
7bc1c432
Commit
7bc1c432
authored
2 years ago
by
martin.zumr
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] use python request instead of urllib
parent
bb929604
No related branches found
No related tags found
3 merge requests
!607
Pirati.cz
,
!592
[ADD] update_articles command
,
!575
Feature/pirati cz
Pipeline
#9475
passed
2 years ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
article_import_utils/services.py
+3
-3
3 additions, 3 deletions
article_import_utils/services.py
with
3 additions
and
3 deletions
article_import_utils/services.py
+
3
−
3
View file @
7bc1c432
...
...
@@ -2,7 +2,7 @@ import json
import
logging
from
typing
import
TYPE_CHECKING
import
urllib3
import
requests
from
article_import_utils.utils
import
create_image_from_url
from
main.models
import
MainArticlePage
,
MainArticlesPage
,
ARTICLE_TYPES
...
...
@@ -21,8 +21,8 @@ class ArticleDownloadService:
return
MainArticlePage
.
objects
.
filter
(
article_type
=
ARTICLE_TYPES
.
WORK_TIMELINE
).
values_list
(
'
slug
'
,
flat
=
True
)
def
get_articles_response
(
self
):
response
=
urllib3
.
PoolManager
().
request
(
'
GET
'
,
self
.
api_url
)
data
=
json
.
loads
(
response
.
data
)
response
=
requests
.
get
(
self
.
api_url
)
data
=
json
.
loads
(
response
.
text
)
return
data
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment