Skip to content

Commit

Permalink
Fix the old poll votes count bug
Browse files Browse the repository at this point in the history
Signed-off-by: marcin mikołajczak <[email protected]>
  • Loading branch information
mkljczk committed Oct 20, 2024
1 parent 2cdc198 commit 42e75ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/pleroma/object/updater.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,6 +117,8 @@ defmodule Pleroma.Object.Updater 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
Expand Down

0 comments on commit 42e75ad

Please sign in to comment.