Fix the old poll votes count bug
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
2cdc1985a5
commit
46dc19275b
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
defmodule Pleroma.Object.Updater do
|
||||
require Pleroma.Constants
|
||||
|
||||
alias Pleroma.Maps
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Workers.EventReminderWorker
|
||||
|
@ -116,6 +117,7 @@ defp maybe_update_poll(to_be_updated, updated_object) do
|
|||
# Choices are the same, but counts are different
|
||||
to_be_updated
|
||||
|> Map.put(key, updated_object[key])
|
||||
|> Maps.put_if_present("votersCount", updated_object["votersCount"])
|
||||
else
|
||||
# Choices (or vote type) have changed, do not allow this
|
||||
_ -> to_be_updated
|
||||
|
|
Loading…
Reference in a new issue