mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-03 05:48:42 +00:00
Permit backdating the poll closed timestamp
This commit is contained in:
parent
766edfe5b2
commit
b2340b5b77
1 changed files with 2 additions and 1 deletions
|
@ -241,6 +241,7 @@ defmodule Pleroma.Factory do
|
||||||
|
|
||||||
def question_factory(attrs \\ %{}) do
|
def question_factory(attrs \\ %{}) do
|
||||||
user = attrs[:user] || insert(:user)
|
user = attrs[:user] || insert(:user)
|
||||||
|
closed = attrs[:closed] || DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601()
|
||||||
|
|
||||||
data = %{
|
data = %{
|
||||||
"id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
|
"id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
|
||||||
|
@ -251,7 +252,7 @@ defmodule Pleroma.Factory do
|
||||||
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
"cc" => [user.follower_address],
|
"cc" => [user.follower_address],
|
||||||
"context" => Pleroma.Web.ActivityPub.Utils.generate_context_id(),
|
"context" => Pleroma.Web.ActivityPub.Utils.generate_context_id(),
|
||||||
"closed" => DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601(),
|
"closed" => closed,
|
||||||
"content" => "Which flavor of ice cream do you prefer?",
|
"content" => "Which flavor of ice cream do you prefer?",
|
||||||
"oneOf" => [
|
"oneOf" => [
|
||||||
%{
|
%{
|
||||||
|
|
Loading…
Reference in a new issue