No return object

main
Bob Mottram 2020-08-23 16:11:42 +01:00
parent 3bd8f96994
commit e90f1d4f2c
1 changed files with 14 additions and 17 deletions

View File

@ -619,13 +619,11 @@ def appendEventFields(newPost: {},
eventDateStr: str,
endDateStr: str,
location: str,
maximumAttendeeCapacity: int) -> {}:
maximumAttendeeCapacity: int) -> None:
"""Appends Mobilizon-type event fields to a post
"""
return newPost
if not eventUUID:
return newPost
return
# add attributes for Mobilizon-type events
newPost['uuid'] = eventUUID
@ -646,7 +644,6 @@ def appendEventFields(newPost: {},
newPost['location'] = location
if maximumAttendeeCapacity:
newPost['maximumAttendeeCapacity'] = maximumAttendeeCapacity
return newPost
def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
@ -894,12 +891,12 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
attachMedia(baseDir, httpPrefix, domain, port,
newPost['object'], attachImageFilename,
mediaType, imageDescription, useBlurhash)
#newPost = appendEventFields(newPost['object'], eventUUID, eventStatus,
# anonymousParticipationEnabled,
# repliesModerationOption,
# category, joinMode,
# eventDateStr, endDateStr,
# location, maximumAttendeeCapacity)
appendEventFields(newPost['object'], eventUUID, eventStatus,
anonymousParticipationEnabled,
repliesModerationOption,
category, joinMode,
eventDateStr, endDateStr,
location, maximumAttendeeCapacity)
else:
idStr = \
httpPrefix + '://' + domain + '/users/' + nickname + \
@ -941,12 +938,12 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
attachMedia(baseDir, httpPrefix, domain, port,
newPost, attachImageFilename,
mediaType, imageDescription, useBlurhash)
#newPost = appendEventFields(newPost, eventUUID, eventStatus,
# anonymousParticipationEnabled,
# repliesModerationOption,
# category, joinMode,
# eventDateStr, endDateStr,
# location, maximumAttendeeCapacity)
appendEventFields(newPost, eventUUID, eventStatus,
anonymousParticipationEnabled,
repliesModerationOption,
category, joinMode,
eventDateStr, endDateStr,
location, maximumAttendeeCapacity)
if ccUrl:
if len(ccUrl) > 0:
newPost['cc'] = [ccUrl]