summaryrefslogtreecommitdiffstats
path: root/users/models/follow.py
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-09 22:29:33 -0700
committerAndrew Godwin2022-11-09 22:29:49 -0700
commit7746abbbb7700fa918450101bbc6d29ed9b4b608 (patch)
tree8768efd8201faa2fee18e5d3b46f33785002f5d6 /users/models/follow.py
parent61c324508e62bb640b4526183d0837fc57d742c2 (diff)
downloadtakahe-7746abbbb7700fa918450101bbc6d29ed9b4b608.tar.gz
takahe-7746abbbb7700fa918450101bbc6d29ed9b4b608.tar.bz2
takahe-7746abbbb7700fa918450101bbc6d29ed9b4b608.zip
Most of the way through the stator refactor
Diffstat (limited to 'users/models/follow.py')
-rw-r--r--users/models/follow.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/users/models/follow.py b/users/models/follow.py
index 04f90ee..3325a0b 100644
--- a/users/models/follow.py
+++ b/users/models/follow.py
@@ -6,13 +6,13 @@ from stator.models import State, StateField, StateGraph, StatorModel
class FollowStates(StateGraph):
- pending = State(try_interval=3600)
+ pending = State(try_interval=30)
requested = State()
accepted = State()
@pending.add_transition(requested)
- async def try_request(cls, instance):
- print("Would have tried to follow")
+ async def try_request(instance: "Follow"): # type:ignore
+ print("Would have tried to follow on", instance)
return False
requested.add_manual_transition(accepted)
@@ -73,11 +73,3 @@ class Follow(StatorModel):
follow.state = FollowStates.accepted
follow.save()
return follow
-
- def undo(self):
- """
- Undoes this follow
- """
- if not self.target.local:
- Task.submit("follow_undo", str(self.pk))
- self.delete()