Ensure that we restore the site setting in posts:rebake rake task.
This commit is contained in:
parent
875008522d
commit
59a2767de8
|
@ -81,6 +81,7 @@ end
|
||||||
def rebake_posts(opts = {})
|
def rebake_posts(opts = {})
|
||||||
puts "Rebaking post markdown for '#{RailsMultisite::ConnectionManagement.current_db}'"
|
puts "Rebaking post markdown for '#{RailsMultisite::ConnectionManagement.current_db}'"
|
||||||
|
|
||||||
|
begin
|
||||||
disable_edit_notifications = SiteSetting.disable_edit_notifications
|
disable_edit_notifications = SiteSetting.disable_edit_notifications
|
||||||
SiteSetting.disable_edit_notifications = true
|
SiteSetting.disable_edit_notifications = true
|
||||||
|
|
||||||
|
@ -94,8 +95,9 @@ def rebake_posts(opts = {})
|
||||||
print_status(rebaked += 1, total)
|
print_status(rebaked += 1, total)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
SiteSetting.disable_edit_notifications = disable_edit_notifications
|
SiteSetting.disable_edit_notifications = disable_edit_notifications
|
||||||
|
end
|
||||||
|
|
||||||
puts "", "#{rebaked} posts done!", "-" * 50
|
puts "", "#{rebaked} posts done!", "-" * 50
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue