A couple bugs in loading authors
This commit is contained in:
parent
e9393ede28
commit
3a8d84e9b1
|
@ -198,6 +198,8 @@ def has_attr(obj, key):
|
||||||
|
|
||||||
def get_date(date_string):
|
def get_date(date_string):
|
||||||
''' helper function to try to interpret dates '''
|
''' helper function to try to interpret dates '''
|
||||||
|
if not date_string:
|
||||||
|
return None
|
||||||
try:
|
try:
|
||||||
return pytz.utc.localize(parser.parse(date_string))
|
return pytz.utc.localize(parser.parse(date_string))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
@ -150,7 +150,12 @@ class Connector(AbstractConnector):
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
resp = requests.get('%s/authors/%s.json' % (self.base_url, remote_id))
|
resp = requests.get(
|
||||||
|
remote_id,
|
||||||
|
headers={
|
||||||
|
'Accept': 'application/activity+json; charset=utf-8',
|
||||||
|
},
|
||||||
|
)
|
||||||
if not resp.ok:
|
if not resp.ok:
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue