DEV: use 'user_created' discourse event instead of 'after_commit' model callback.

This commit is contained in:
Vinoth Kannan 2019-10-04 10:48:49 +05:30
parent 8ccd286721
commit 5a919c2211
1 changed files with 3 additions and 3 deletions

View File

@ -120,9 +120,9 @@ after_initialize do
DiscourseNarrativeBot::Store.remove(self.id)
end
self.add_model_callback(User, :after_commit, on: :create) do
if SiteSetting.discourse_narrative_bot_welcome_post_delay == 0 && !self.staged
self.enqueue_bot_welcome_post
self.on(:user_created) do |user|
if SiteSetting.discourse_narrative_bot_welcome_post_delay == 0 && !user.staged
user.enqueue_bot_welcome_post
end
end