Skip to content

Commit d2831d1

Browse files
author
Jan Mikula
committed
fixing SSL errors
1 parent 10ed2e7 commit d2831d1

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

server/articles/management/commands/publishissues.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import datetime
33
from datetime import timedelta
44
import time
5+
import ssl
56

67
import pytz
78

@@ -17,6 +18,7 @@
1718
from articles.timeline import NewspaperTimelineIssue
1819
from utils.json import Entities, Ref
1920

21+
ssl._create_default_https_context = ssl._create_unverified_context
2022

2123
class Command(BaseCommand):
2224
help = 'Release issues with posts marked to publish'

server/articles/management/commands/renewsubscriptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import time
2+
import ssl
23
from datetime import timedelta
34

45
from dateutil.relativedelta import relativedelta
@@ -12,6 +13,7 @@
1213
from articles.views import SUBSCRIPTIONS_CACHE_KEY
1314
from credits.utils import get_user_credits, pay_author_subscription, pay_newspaper_subscription
1415

16+
ssl._create_default_https_context = ssl._create_unverified_context
1517

1618
class Command(BaseCommand):
1719
help = 'Extend subscriptions to be expired and marked for renew'

server/articles/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from decimal import ConversionSyntax, Decimal
66
from operator import attrgetter
77
import urllib.parse
8+
import ssl
89

910
import requests
1011
import pytz
@@ -37,6 +38,8 @@
3738
from .period import parse_periodicity
3839
from .signals import post_publish
3940

41+
ssl._create_default_https_context = ssl._create_unverified_context
42+
4043
AUTOR_POSTS_PAGE_SIZE = 20
4144

4245
SUBSCRIPTIONS_CACHE_KEY = 'subscriptions-{}'

0 commit comments

Comments
 (0)