mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 15:05:45 +00:00
Don't reject already accepted subscriptions.
This commit is contained in:
parent
2b980dea2f
commit
b4f055b604
|
@ -31,9 +31,9 @@ defmodule Pleroma.Web.Websub do
|
||||||
do
|
do
|
||||||
changeset = Changeset.change(subscription, %{state: "active"})
|
changeset = Changeset.change(subscription, %{state: "active"})
|
||||||
Repo.update(changeset)
|
Repo.update(changeset)
|
||||||
else _e ->
|
else e ->
|
||||||
changeset = Changeset.change(subscription, %{state: "rejected"})
|
Logger.debug("Couldn't verify subscription")
|
||||||
{:ok, subscription} = Repo.update(changeset)
|
Logger.debug(inspect(e))
|
||||||
{:error, subscription}
|
{:error, subscription}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,8 @@ defmodule Pleroma.Web.WebsubTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
{:error, sub} = Websub.verify(sub, getter)
|
{:error, sub} = Websub.verify(sub, getter)
|
||||||
assert sub.state == "rejected"
|
# Keep the current state.
|
||||||
|
assert sub.state == "requested"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "an incoming subscription request" do
|
test "an incoming subscription request" do
|
||||||
|
|
Loading…
Reference in a new issue