mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 02:29:17 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -2,66 +2,59 @@ from . import serializers
|
|||
from . import tasks
|
||||
|
||||
ACTIVITY_TYPES = [
|
||||
'Accept',
|
||||
'Add',
|
||||
'Announce',
|
||||
'Arrive',
|
||||
'Block',
|
||||
'Create',
|
||||
'Delete',
|
||||
'Dislike',
|
||||
'Flag',
|
||||
'Follow',
|
||||
'Ignore',
|
||||
'Invite',
|
||||
'Join',
|
||||
'Leave',
|
||||
'Like',
|
||||
'Listen',
|
||||
'Move',
|
||||
'Offer',
|
||||
'Question',
|
||||
'Reject',
|
||||
'Read',
|
||||
'Remove',
|
||||
'TentativeReject',
|
||||
'TentativeAccept',
|
||||
'Travel',
|
||||
'Undo',
|
||||
'Update',
|
||||
'View',
|
||||
"Accept",
|
||||
"Add",
|
||||
"Announce",
|
||||
"Arrive",
|
||||
"Block",
|
||||
"Create",
|
||||
"Delete",
|
||||
"Dislike",
|
||||
"Flag",
|
||||
"Follow",
|
||||
"Ignore",
|
||||
"Invite",
|
||||
"Join",
|
||||
"Leave",
|
||||
"Like",
|
||||
"Listen",
|
||||
"Move",
|
||||
"Offer",
|
||||
"Question",
|
||||
"Reject",
|
||||
"Read",
|
||||
"Remove",
|
||||
"TentativeReject",
|
||||
"TentativeAccept",
|
||||
"Travel",
|
||||
"Undo",
|
||||
"Update",
|
||||
"View",
|
||||
]
|
||||
|
||||
|
||||
OBJECT_TYPES = [
|
||||
'Article',
|
||||
'Audio',
|
||||
'Collection',
|
||||
'Document',
|
||||
'Event',
|
||||
'Image',
|
||||
'Note',
|
||||
'OrderedCollection',
|
||||
'Page',
|
||||
'Place',
|
||||
'Profile',
|
||||
'Relationship',
|
||||
'Tombstone',
|
||||
'Video',
|
||||
"Article",
|
||||
"Audio",
|
||||
"Collection",
|
||||
"Document",
|
||||
"Event",
|
||||
"Image",
|
||||
"Note",
|
||||
"OrderedCollection",
|
||||
"Page",
|
||||
"Place",
|
||||
"Profile",
|
||||
"Relationship",
|
||||
"Tombstone",
|
||||
"Video",
|
||||
] + ACTIVITY_TYPES
|
||||
|
||||
|
||||
def deliver(activity, on_behalf_of, to=[]):
|
||||
return tasks.send.delay(
|
||||
activity=activity,
|
||||
actor_id=on_behalf_of.pk,
|
||||
to=to
|
||||
)
|
||||
return tasks.send.delay(activity=activity, actor_id=on_behalf_of.pk, to=to)
|
||||
|
||||
|
||||
def accept_follow(follow):
|
||||
serializer = serializers.AcceptFollowSerializer(follow)
|
||||
return deliver(
|
||||
serializer.data,
|
||||
to=[follow.actor.url],
|
||||
on_behalf_of=follow.target)
|
||||
return deliver(serializer.data, to=[follow.actor.url], on_behalf_of=follow.target)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue