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 %} {% endif %}
{% if follow %} {% if follow %}
<input type="hidden" name="action" value="unfollow"> <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 %} {% else %}
<input type="hidden" name="action" value="follow"> <input type="hidden" name="action" value="follow">
<button>Follow</button> <button>Follow</button>

View File

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