Commit b4f055b6 authored by lain's avatar lain
Browse files

Don't reject already accepted subscriptions.

parent 2b980dea
......@@ -31,9 +31,9 @@ def verify(subscription, getter \\ &@httpoison.get/3) do
do
changeset = Changeset.change(subscription, %{state: "active"})
Repo.update(changeset)
else _e ->
changeset = Changeset.change(subscription, %{state: "rejected"})
{:ok, subscription} = Repo.update(changeset)
else e ->
Logger.debug("Couldn't verify subscription")
Logger.debug(inspect(e))
{:error, subscription}
end
end
......
......@@ -46,7 +46,8 @@ test "a verification of a request that doesn't return 200" do
end
{:error, sub} = Websub.verify(sub, getter)
assert sub.state == "rejected"
# Keep the current state.
assert sub.state == "requested"
end
test "an incoming subscription request" do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment