parent
7eff751224
commit
52b4384cd6
|
@ -144,6 +144,8 @@ class Follow(StatorModel):
|
||||||
Creates a Follow from a local Identity to the target
|
Creates a Follow from a local Identity to the target
|
||||||
(which can be local or remote).
|
(which can be local or remote).
|
||||||
"""
|
"""
|
||||||
|
from activities.models import TimelineEvent
|
||||||
|
|
||||||
if not source.local:
|
if not source.local:
|
||||||
raise ValueError("You cannot initiate follows from a remote Identity")
|
raise ValueError("You cannot initiate follows from a remote Identity")
|
||||||
try:
|
try:
|
||||||
|
@ -154,6 +156,7 @@ class Follow(StatorModel):
|
||||||
# TODO: Local follow approvals
|
# TODO: Local follow approvals
|
||||||
if target.local:
|
if target.local:
|
||||||
follow.state = FollowStates.accepted
|
follow.state = FollowStates.accepted
|
||||||
|
TimelineEvent.add_follow(follow.target, follow.source)
|
||||||
follow.save()
|
follow.save()
|
||||||
return follow
|
return follow
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue