mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-18 07:33:57 +00:00
Merge pull request #1270 from bookwyrm-social/request-exception
Uses more general requests exception
This commit is contained in:
commit
187e2e0d08
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ import operator
|
||||||
import logging
|
import logging
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
import requests
|
import requests
|
||||||
from requests.exceptions import HTTPError, SSLError
|
from requests.exceptions import RequestException
|
||||||
|
|
||||||
from Crypto.PublicKey import RSA
|
from Crypto.PublicKey import RSA
|
||||||
from Crypto.Signature import pkcs1_15
|
from Crypto.Signature import pkcs1_15
|
||||||
|
@ -43,7 +43,7 @@ class ActivitypubMixin:
|
||||||
reverse_unfurl = False
|
reverse_unfurl = False
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""collect some info on model fields"""
|
"""collect some info on model fields for later use"""
|
||||||
self.image_fields = []
|
self.image_fields = []
|
||||||
self.many_to_many_fields = []
|
self.many_to_many_fields = []
|
||||||
self.simple_fields = [] # "simple"
|
self.simple_fields = [] # "simple"
|
||||||
|
@ -503,7 +503,7 @@ def broadcast_task(sender_id, activity, recipients):
|
||||||
for recipient in recipients:
|
for recipient in recipients:
|
||||||
try:
|
try:
|
||||||
sign_and_send(sender, activity, recipient)
|
sign_and_send(sender, activity, recipient)
|
||||||
except (HTTPError, SSLError, requests.exceptions.ConnectionError):
|
except RequestException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue