Show when a follow is pending

This commit is contained in:
Andrew Godwin 2022-12-22 05:54:01 +00:00
parent 9415ebb4f4
commit 8729baaea4
2 changed files with 9 additions and 1 deletions

View file

@ -31,7 +31,9 @@
{% endif %}
{% if follow %}
<input type="hidden" name="action" value="unfollow">
<button class="destructive">Unfollow</button>
<button class="destructive">
{% if follow.pending %}Follow Pending{% else %}Unfollow{% endif %}
</button>
{% else %}
<input type="hidden" name="action" value="follow">
<button>Follow</button>

View file

@ -167,6 +167,12 @@ class Follow(StatorModel):
"source", "source__domain", "target"
).aget(pk=self.pk)
### Helper properties ###
@property
def pending(self):
return self.state in [FollowStates.unrequested, FollowStates.local_requested]
### ActivityPub (outbound) ###
def to_ap(self):