mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
FIX: Update draft count when sequence is increased (#13940)
* FIX: Update draft count when sequence is increased Sometimes users ended up having a draft count higher than the actual number of drafts. * FIX: Do not update draft count twice The call to DraftSequence.next! above already does it.
This commit is contained in:
@ -23,6 +23,8 @@ class DraftSequence < ActiveRecord::Base
|
||||
|
||||
DB.exec("DELETE FROM drafts WHERE user_id = :user_id AND draft_key = :draft_key AND sequence < :sequence", draft_key: key, user_id: user_id, sequence: sequence)
|
||||
|
||||
UserStat.update_draft_count(user_id)
|
||||
|
||||
sequence
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user