Snake case

merge-requests/30/head
Bob Mottram 2021-12-26 17:12:07 +00:00
parent 54d903a47c
commit b71d662d8e
16 changed files with 60 additions and 60 deletions

View File

@ -20,7 +20,7 @@ from utils import acct_dir
from utils import hasGroupType from utils import hasGroupType
from utils import local_actor_url from utils import local_actor_url
from utils import hasActor from utils import hasActor
from utils import hasObjectStringType from utils import has_object_stringType
def _create_accept_reject(base_dir: str, federation_list: [], def _create_accept_reject(base_dir: str, federation_list: [],
@ -79,7 +79,7 @@ def _accept_follow(base_dir: str, domain: str, message_json: {},
federation_list: [], debug: bool) -> None: federation_list: [], debug: bool) -> None:
"""Receiving a follow Accept activity """Receiving a follow Accept activity
""" """
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Follow': if not message_json['object']['type'] == 'Follow':
if not message_json['object']['type'] == 'Join': if not message_json['object']['type'] == 'Join':

View File

@ -25,7 +25,7 @@ from utils import updateAnnounceCollection
from utils import local_actor_url from utils import local_actor_url
from utils import replaceUsersWithAt from utils import replaceUsersWithAt
from utils import hasActor from utils import hasActor
from utils import hasObjectStringType from utils import has_object_stringType
from posts import sendSignedJson from posts import sendSignedJson
from posts import getPersonBox from posts import getPersonBox
from session import postJson from session import postJson
@ -82,7 +82,7 @@ def outboxAnnounce(recentPostsCache: {},
nickname, domain, debug) nickname, domain, debug)
return True return True
elif message_json['type'] == 'Undo': elif message_json['type'] == 'Undo':
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if message_json['object']['type'] == 'Announce': if message_json['object']['type'] == 'Announce':
if not isinstance(message_json['object']['object'], str): if not isinstance(message_json['object']['object'], str):
@ -396,7 +396,7 @@ def outboxUndoAnnounce(recentPostsCache: {},
return return
if not message_json['type'] == 'Undo': if not message_json['type'] == 'Undo':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Announce': if not message_json['object']['type'] == 'Announce':
if debug: if debug:

View File

@ -12,7 +12,7 @@ from webfinger import webfingerHandle
from auth import createBasicAuthHeader from auth import createBasicAuthHeader
from posts import getPersonBox from posts import getPersonBox
from session import postJson from session import postJson
from utils import hasObjectString from utils import has_object_string
from utils import get_full_domain from utils import get_full_domain
from utils import getNicknameFromActor from utils import getNicknameFromActor
from utils import getDomainFromActor from utils import getDomainFromActor
@ -64,7 +64,7 @@ def outboxAvailability(base_dir: str, nickname: str, message_json: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
actorNickname = getNicknameFromActor(message_json['actor']) actorNickname = getNicknameFromActor(message_json['actor'])

View File

@ -11,9 +11,9 @@ import os
import json import json
import time import time
from datetime import datetime from datetime import datetime
from utils import hasObjectString from utils import has_object_string
from utils import has_object_string_object from utils import has_object_string_object
from utils import hasObjectStringType from utils import has_object_stringType
from utils import removeDomainPort from utils import removeDomainPort
from utils import has_object_dict from utils import has_object_dict
from utils import isAccountDir from utils import isAccountDir
@ -427,7 +427,7 @@ def outboxBlock(base_dir: str, http_prefix: str,
if debug: if debug:
print('DEBUG: not a block') print('DEBUG: not a block')
return False return False
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
if debug: if debug:
print('DEBUG: c2s block request arrived in outbox') print('DEBUG: c2s block request arrived in outbox')
@ -477,7 +477,7 @@ def outboxUndoBlock(base_dir: str, http_prefix: str,
print('DEBUG: not an undo block') print('DEBUG: not an undo block')
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Block': if not message_json['object']['type'] == 'Block':
if debug: if debug:
@ -540,7 +540,7 @@ def mutePost(base_dir: str, nickname: str, domain: str, port: int,
if has_object_dict(post_json_object): if has_object_dict(post_json_object):
postJsonObj = post_json_object['object'] postJsonObj = post_json_object['object']
else: else:
if hasObjectString(post_json_object, debug): if has_object_string(post_json_object, debug):
alsoUpdatePostId = removeIdEnding(post_json_object['object']) alsoUpdatePostId = removeIdEnding(post_json_object['object'])
domain_full = get_full_domain(domain, port) domain_full = get_full_domain(domain, port)
@ -679,7 +679,7 @@ def unmutePost(base_dir: str, nickname: str, domain: str, port: int,
if has_object_dict(post_json_object): if has_object_dict(post_json_object):
postJsonObj = post_json_object['object'] postJsonObj = post_json_object['object']
else: else:
if hasObjectString(post_json_object, debug): if has_object_string(post_json_object, debug):
alsoUpdatePostId = removeIdEnding(post_json_object['object']) alsoUpdatePostId = removeIdEnding(post_json_object['object'])
if postJsonObj.get('conversation'): if postJsonObj.get('conversation'):
@ -783,7 +783,7 @@ def outboxMute(base_dir: str, http_prefix: str,
return return
if not message_json['type'] == 'Ignore': if not message_json['type'] == 'Ignore':
return return
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return return
if debug: if debug:
print('DEBUG: c2s mute request arrived in outbox') print('DEBUG: c2s mute request arrived in outbox')
@ -832,7 +832,7 @@ def outboxUndoMute(base_dir: str, http_prefix: str,
return return
if not message_json['type'] == 'Undo': if not message_json['type'] == 'Undo':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if message_json['object']['type'] != 'Ignore': if message_json['object']['type'] != 'Ignore':
return return

View File

@ -27,7 +27,7 @@ from utils import has_object_dict
from utils import acct_dir from utils import acct_dir
from utils import local_actor_url from utils import local_actor_url
from utils import hasActor from utils import hasActor
from utils import hasObjectStringType from utils import has_object_stringType
from posts import getPersonBox from posts import getPersonBox
from session import postJson from session import postJson
@ -566,7 +566,7 @@ def outboxBookmark(recentPostsCache: {},
if debug: if debug:
print('DEBUG: no target in bookmark Add') print('DEBUG: no target in bookmark Add')
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not isinstance(message_json['target'], str): if not isinstance(message_json['target'], str):
if debug: if debug:
@ -622,7 +622,7 @@ def outboxUndoBookmark(recentPostsCache: {},
if debug: if debug:
print('DEBUG: no target in unbookmark Remove') print('DEBUG: no target in unbookmark Remove')
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not isinstance(message_json['target'], str): if not isinstance(message_json['target'], str):
if debug: if debug:

View File

@ -9,7 +9,7 @@ __module_group__ = "ActivityPub"
import os import os
from datetime import datetime from datetime import datetime
from utils import hasObjectString from utils import has_object_string
from utils import removeDomainPort from utils import removeDomainPort
from utils import has_users_path from utils import has_users_path
from utils import get_full_domain from utils import get_full_domain
@ -127,7 +127,7 @@ def outboxDelete(base_dir: str, http_prefix: str,
if debug: if debug:
print('DEBUG: not a delete') print('DEBUG: not a delete')
return return
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return return
if debug: if debug:
print('DEBUG: c2s delete request arrived in outbox') print('DEBUG: c2s delete request arrived in outbox')

View File

@ -10,7 +10,7 @@ __module_group__ = "ActivityPub"
from pprint import pprint from pprint import pprint
import os import os
from utils import has_object_string_object from utils import has_object_string_object
from utils import hasObjectStringType from utils import has_object_stringType
from utils import removeDomainPort from utils import removeDomainPort
from utils import has_users_path from utils import has_users_path
from utils import get_full_domain from utils import get_full_domain
@ -1385,7 +1385,7 @@ def outboxUndoFollow(base_dir: str, message_json: {}, debug: bool) -> None:
return return
if not message_json['type'] == 'Undo': if not message_json['type'] == 'Undo':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Follow': if not message_json['object']['type'] == 'Follow':
if not message_json['object']['type'] == 'Join': if not message_json['object']['type'] == 'Join':

4
git.py
View File

@ -10,7 +10,7 @@ __module_group__ = "Profile Metadata"
import os import os
import html import html
from utils import acct_dir from utils import acct_dir
from utils import hasObjectStringType from utils import has_object_stringType
def _gitFormatContent(content: str) -> str: def _gitFormatContent(content: str) -> str:
@ -116,7 +116,7 @@ def convertPostToPatch(base_dir: str, nickname: str, domain: str,
"""Detects whether the given post contains a patch """Detects whether the given post contains a patch
and if so then converts it to a Patch ActivityPub type and if so then converts it to a Patch ActivityPub type
""" """
if not hasObjectStringType(post_json_object, False): if not has_object_stringType(post_json_object, False):
return False return False
if post_json_object['object']['type'] == 'Patch': if post_json_object['object']['type'] == 'Patch':
return True return True

View File

@ -23,7 +23,7 @@ from utils import isSystemAccount
from utils import invalidCiphertext from utils import invalidCiphertext
from utils import removeHtml from utils import removeHtml
from utils import fileLastModified from utils import fileLastModified
from utils import hasObjectString from utils import has_object_string
from utils import has_object_string_object from utils import has_object_string_object
from utils import getReplyIntervalHours from utils import getReplyIntervalHours
from utils import canReplyTo from utils import canReplyTo
@ -60,7 +60,7 @@ from utils import undoLikesCollectionEntry
from utils import undoReactionCollectionEntry from utils import undoReactionCollectionEntry
from utils import hasGroupType from utils import hasGroupType
from utils import local_actor_url from utils import local_actor_url
from utils import hasObjectStringType from utils import has_object_stringType
from categories import getHashtagCategories from categories import getHashtagCategories
from categories import setHashtagCategory from categories import setHashtagCategory
from httpsig import getDigestAlgorithmFromHeaders from httpsig import getDigestAlgorithmFromHeaders
@ -811,7 +811,7 @@ def _receiveUndo(session, base_dir: str, http_prefix: str,
if debug: if debug:
print('DEBUG: "users" or "profile" missing from actor') print('DEBUG: "users" or "profile" missing from actor')
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if not has_object_string_object(message_json, debug): if not has_object_string_object(message_json, debug):
return False return False
@ -951,7 +951,7 @@ def _receiveUpdate(recentPostsCache: {}, session, base_dir: str,
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if not has_users_path(message_json['actor']): if not has_users_path(message_json['actor']):
if debug: if debug:
@ -1015,7 +1015,7 @@ def _receiveLike(recentPostsCache: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
if not message_json.get('to'): if not message_json.get('to'):
if debug: if debug:
@ -1137,7 +1137,7 @@ def _receiveUndoLike(recentPostsCache: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if message_json['object']['type'] != 'Like': if message_json['object']['type'] != 'Like':
return False return False
@ -1249,7 +1249,7 @@ def _receiveReaction(recentPostsCache: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
if not message_json.get('to'): if not message_json.get('to'):
if debug: if debug:
@ -1398,7 +1398,7 @@ def _receiveUndoReaction(recentPostsCache: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if message_json['object']['type'] != 'EmojiReact': if message_json['object']['type'] != 'EmojiReact':
return False return False
@ -1530,7 +1530,7 @@ def _receiveBookmark(recentPostsCache: {},
if debug: if debug:
print('DEBUG: no target in inbox bookmark Add') print('DEBUG: no target in inbox bookmark Add')
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if not isinstance(message_json['target'], str): if not isinstance(message_json['target'], str):
if debug: if debug:
@ -1642,7 +1642,7 @@ def _receiveUndoBookmark(recentPostsCache: {},
if debug: if debug:
print('DEBUG: no target in inbox undo bookmark Remove') print('DEBUG: no target in inbox undo bookmark Remove')
return False return False
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return False return False
if not isinstance(message_json['target'], str): if not isinstance(message_json['target'], str):
if debug: if debug:
@ -1739,7 +1739,7 @@ def _receiveDelete(session, handle: str, isGroup: bool, base_dir: str,
return False return False
if debug: if debug:
print('DEBUG: Delete activity arrived') print('DEBUG: Delete activity arrived')
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
domain_full = get_full_domain(domain, port) domain_full = get_full_domain(domain, port)
deletePrefix = http_prefix + '://' + domain_full + '/' deletePrefix = http_prefix + '://' + domain_full + '/'
@ -1829,7 +1829,7 @@ def _receiveAnnounce(recentPostsCache: {},
return False return False
if debug: if debug:
print('DEBUG: receiving announce on ' + handle) print('DEBUG: receiving announce on ' + handle)
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
if not message_json.get('to'): if not message_json.get('to'):
if debug: if debug:

View File

@ -9,9 +9,9 @@ __module_group__ = "ActivityPub"
import os import os
from pprint import pprint from pprint import pprint
from utils import hasObjectString from utils import has_object_string
from utils import has_object_string_object from utils import has_object_string_object
from utils import hasObjectStringType from utils import has_object_stringType
from utils import removeDomainPort from utils import removeDomainPort
from utils import has_object_dict from utils import has_object_dict
from utils import has_users_path from utils import has_users_path
@ -353,7 +353,7 @@ def outboxLike(recentPostsCache: {},
if debug: if debug:
print('DEBUG: not a like') print('DEBUG: not a like')
return return
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return return
if debug: if debug:
print('DEBUG: c2s like request arrived in outbox') print('DEBUG: c2s like request arrived in outbox')
@ -384,7 +384,7 @@ def outboxUndoLike(recentPostsCache: {},
return return
if not message_json['type'] == 'Undo': if not message_json['type'] == 'Undo':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Like': if not message_json['object']['type'] == 'Like':
if debug: if debug:

View File

@ -16,7 +16,7 @@ from posts import outboxMessageCreateWrap
from posts import savePostToBox from posts import savePostToBox
from posts import sendToFollowersThread from posts import sendToFollowersThread
from posts import sendToNamedAddressesThread from posts import sendToNamedAddressesThread
from utils import hasObjectStringType from utils import has_object_stringType
from utils import get_base_content_from_post from utils import get_base_content_from_post
from utils import has_object_dict from utils import has_object_dict
from utils import getLocalNetworkAddresses from utils import getLocalNetworkAddresses
@ -76,7 +76,7 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
return return
if message_json['type'] != 'Update': if message_json['type'] != 'Update':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not isinstance(message_json['object']['type'], str): if not isinstance(message_json['object']['type'], str):
if debug: if debug:

View File

@ -34,7 +34,7 @@ from siteactive import siteIsActive
from languages import understoodPostLanguage from languages import understoodPostLanguage
from utils import get_user_paths from utils import get_user_paths
from utils import invalidCiphertext from utils import invalidCiphertext
from utils import hasObjectStringType from utils import has_object_stringType
from utils import removeIdEnding from utils import removeIdEnding
from utils import replaceUsersWithAt from utils import replaceUsersWithAt
from utils import hasGroupType from utils import hasGroupType
@ -2850,7 +2850,7 @@ def _isProfileUpdate(post_json_object: {}) -> bool:
for actor updates there is no 'to' within the object for actor updates there is no 'to' within the object
""" """
if post_json_object.get('type'): if post_json_object.get('type'):
if hasObjectStringType(post_json_object, False): if has_object_stringType(post_json_object, False):
if (post_json_object['type'] == 'Update' and if (post_json_object['type'] == 'Update' and
(post_json_object['object']['type'] == 'Person' or (post_json_object['object']['type'] == 'Person' or
post_json_object['object']['type'] == 'Application' or post_json_object['object']['type'] == 'Application' or
@ -2891,7 +2891,7 @@ def _sendToNamedAddresses(session, base_dir: str,
pprint(post_json_object) pprint(post_json_object)
print('DEBUG: ' + print('DEBUG: ' +
'no "to" field when sending to named addresses') 'no "to" field when sending to named addresses')
if hasObjectStringType(post_json_object, debug): if has_object_stringType(post_json_object, debug):
if post_json_object['object']['type'] == 'Follow' or \ if post_json_object['object']['type'] == 'Follow' or \
post_json_object['object']['type'] == 'Join': post_json_object['object']['type'] == 'Join':
post_json_obj2 = post_json_object['object']['object'] post_json_obj2 = post_json_object['object']['object']
@ -3077,7 +3077,7 @@ def _sendingProfileUpdate(post_json_object: {}) -> bool:
""" """
if post_json_object['type'] != 'Update': if post_json_object['type'] != 'Update':
return False return False
if not hasObjectStringType(post_json_object, False): if not has_object_stringType(post_json_object, False):
return False return False
activityType = post_json_object['object']['type'] activityType = post_json_object['object']['type']
if activityType == 'Person' or \ if activityType == 'Person' or \

View File

@ -11,9 +11,9 @@ import os
import re import re
import urllib.parse import urllib.parse
from pprint import pprint from pprint import pprint
from utils import hasObjectString from utils import has_object_string
from utils import has_object_string_object from utils import has_object_string_object
from utils import hasObjectStringType from utils import has_object_stringType
from utils import removeDomainPort from utils import removeDomainPort
from utils import has_object_dict from utils import has_object_dict
from utils import has_users_path from utils import has_users_path
@ -368,7 +368,7 @@ def outboxReaction(recentPostsCache: {},
if debug: if debug:
print('DEBUG: not a reaction') print('DEBUG: not a reaction')
return return
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return return
if not message_json.get('content'): if not message_json.get('content'):
return return
@ -408,7 +408,7 @@ def outboxUndoReaction(recentPostsCache: {},
return return
if not message_json['type'] == 'Undo': if not message_json['type'] == 'Undo':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'EmojiReact': if not message_json['object']['type'] == 'EmojiReact':
if debug: if debug:

View File

@ -22,7 +22,7 @@ from posts import getPersonBox
from session import postJson from session import postJson
from session import postImage from session import postImage
from session import createSession from session import createSession
from utils import hasObjectStringType from utils import has_object_stringType
from utils import dateStringToSeconds from utils import dateStringToSeconds
from utils import dateSecondsToString from utils import dateSecondsToString
from utils import get_config_param from utils import get_config_param
@ -1039,7 +1039,7 @@ def outboxShareUpload(base_dir: str, http_prefix: str,
return return
if not message_json['type'] == 'Add': if not message_json['type'] == 'Add':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Offer': if not message_json['object']['type'] == 'Offer':
if debug: if debug:
@ -1108,7 +1108,7 @@ def outboxUndoShareUpload(base_dir: str, http_prefix: str,
return return
if not message_json['type'] == 'Remove': if not message_json['type'] == 'Remove':
return return
if not hasObjectStringType(message_json, debug): if not has_object_stringType(message_json, debug):
return return
if not message_json['object']['type'] == 'Offer': if not message_json['object']['type'] == 'Offer':
if debug: if debug:

View File

@ -12,7 +12,7 @@ from webfinger import webfingerHandle
from auth import createBasicAuthHeader from auth import createBasicAuthHeader
from posts import getPersonBox from posts import getPersonBox
from session import postJson from session import postJson
from utils import hasObjectString from utils import has_object_string
from utils import get_full_domain from utils import get_full_domain
from utils import getNicknameFromActor from utils import getNicknameFromActor
from utils import getDomainFromActor from utils import getDomainFromActor
@ -154,7 +154,7 @@ def outboxSkills(base_dir: str, nickname: str, message_json: {},
return False return False
if not hasActor(message_json, debug): if not hasActor(message_json, debug):
return False return False
if not hasObjectString(message_json, debug): if not has_object_string(message_json, debug):
return False return False
actorNickname = getNicknameFromActor(message_json['actor']) actorNickname = getNicknameFromActor(message_json['actor'])

View File

@ -2084,7 +2084,7 @@ def isBlogPost(post_json_object: {}) -> bool:
return False return False
if not has_object_dict(post_json_object): if not has_object_dict(post_json_object):
return False return False
if not hasObjectStringType(post_json_object, False): if not has_object_stringType(post_json_object, False):
return False return False
if not post_json_object['object'].get('content'): if not post_json_object['object'].get('content'):
return False return False
@ -3175,12 +3175,12 @@ def hasActor(post_json_object: {}, debug: bool) -> bool:
return False return False
def hasObjectStringType(post_json_object: {}, debug: bool) -> bool: def has_object_stringType(post_json_object: {}, debug: bool) -> bool:
"""Does the given post have a type field within an object dict? """Does the given post have a type field within an object dict?
""" """
if not has_object_dict(post_json_object): if not has_object_dict(post_json_object):
if debug: if debug:
print('hasObjectStringType no object found') print('has_object_stringType no object found')
return False return False
if post_json_object['object'].get('type'): if post_json_object['object'].get('type'):
if isinstance(post_json_object['object']['type'], str): if isinstance(post_json_object['object']['type'], str):
@ -3199,7 +3199,7 @@ def has_object_string_object(post_json_object: {}, debug: bool) -> bool:
""" """
if not has_object_dict(post_json_object): if not has_object_dict(post_json_object):
if debug: if debug:
print('hasObjectStringType no object found') print('has_object_stringType no object found')
return False return False
if post_json_object['object'].get('object'): if post_json_object['object'].get('object'):
if isinstance(post_json_object['object']['object'], str): if isinstance(post_json_object['object']['object'], str):
@ -3213,7 +3213,7 @@ def has_object_string_object(post_json_object: {}, debug: bool) -> bool:
return False return False
def hasObjectString(post_json_object: {}, debug: bool) -> bool: def has_object_string(post_json_object: {}, debug: bool) -> bool:
"""Does the given post have an object string field? """Does the given post have an object string field?
""" """
if post_json_object.get('object'): if post_json_object.get('object'):