discourse/plugins
Krzysztof Kotlarek 942b9126a1
FIX: no error when double save post with poll (#13111)
Some plugins hook into Post after save to set custom fields and save again.

For example: https://github.com/discourse/discourse-category-experts/blob/main/lib/category_experts/post_handler.rb#L27

Problem is that in case like that `raw_changed?` is false but all callback are triggered. `extracted_polls` is class atribute therefore that should be reset with each attempt.

That was causing an error:
```
#<ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint 
"index_polls_on_post_id_and_name" DETAIL:  Key (post_id, name)=(8967, poll) already exists.
```
2021-05-27 08:39:51 +10:00
..
discourse-details Update translations (#13136) 2021-05-25 15:29:11 +02:00
discourse-local-dates DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
discourse-narrative-bot UX: Make discobot flag tutorial copy clearer (#13148) 2021-05-25 15:34:38 -05:00
discourse-presence DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
lazy-yt DEV: Absorb onebox gem into core (#12979) 2021-05-26 15:11:35 +05:30
poll FIX: no error when double save post with poll (#13111) 2021-05-27 08:39:51 +10:00
styleguide DEV: Remove unused `disabled_plugins` checks (#13144) 2021-05-26 09:44:58 +10:00