mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
21ece75119
commit
2a12ab2bc7
2
posts.py
2
posts.py
|
@ -231,6 +231,8 @@ def parse_user_feed(signing_priv_key_pem: str,
|
||||||
session, feed_url: str, as_header: {},
|
session, feed_url: str, as_header: {},
|
||||||
project_version: str, http_prefix: str,
|
project_version: str, http_prefix: str,
|
||||||
origin_domain: str, debug: bool, depth: int = 0) -> []:
|
origin_domain: str, debug: bool, depth: int = 0) -> []:
|
||||||
|
"""Returns a feed of posts for an account url
|
||||||
|
"""
|
||||||
if depth > 10:
|
if depth > 10:
|
||||||
if debug:
|
if debug:
|
||||||
print('Maximum search depth reached')
|
print('Maximum search depth reached')
|
||||||
|
|
|
@ -10,6 +10,7 @@ __module_group__ = "Web Interface"
|
||||||
import os
|
import os
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from webfinger import webfinger_handle
|
from webfinger import webfinger_handle
|
||||||
|
from utils import get_attributed_to
|
||||||
from utils import get_url_from_post
|
from utils import get_url_from_post
|
||||||
from utils import get_memorials
|
from utils import get_memorials
|
||||||
from utils import text_in_file
|
from utils import text_in_file
|
||||||
|
@ -175,11 +176,12 @@ def _valid_profile_preview_post(post_json_object: {},
|
||||||
if has_object_dict(post_json_object):
|
if has_object_dict(post_json_object):
|
||||||
# convert attributedTo actor back to id
|
# convert attributedTo actor back to id
|
||||||
if post_json_object['object'].get('attributedTo'):
|
if post_json_object['object'].get('attributedTo'):
|
||||||
if isinstance(post_json_object['object']['attributedTo'],
|
attrib_field = post_json_object['object']['attributedTo']
|
||||||
dict):
|
if attrib_field:
|
||||||
if post_json_object['object']['attributedTo'].get('id'):
|
if isinstance(attrib_field, dict):
|
||||||
post_json_object['object']['attributedTo'] = \
|
attrib = get_attributed_to(attrib_field)
|
||||||
post_json_object['object']['attributedTo']['id']
|
if attrib:
|
||||||
|
post_json_object['object']['attributedTo'] = attrib
|
||||||
if not is_announced_feed_item:
|
if not is_announced_feed_item:
|
||||||
actor_url = get_actor_from_post(post_json_object)
|
actor_url = get_actor_from_post(post_json_object)
|
||||||
if actor_url != person_url and \
|
if actor_url != person_url and \
|
||||||
|
|
Loading…
Reference in New Issue