mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:51:09 +08:00
FIX: properly ban non human users from draft system
Previously we had a partial fix in place where non human users were not allowed draft sequences, this left edges around where non human users asked for drafts yet had none. For example system could already have a few drafts in place. This also removes and extensibility point we added that is not in use
This commit is contained in:
@ -405,15 +405,6 @@ class Plugin::Instance
|
||||
SeedFu.fixture_paths.concat(paths)
|
||||
end
|
||||
|
||||
# Applies to all sites in a multisite environment. Block is not called if
|
||||
# plugin is not enabled. Block is called with `user_id` and has to return a
|
||||
# boolean based on whether the given `user_id` should be ignored.
|
||||
def register_ignore_draft_sequence_callback(&block)
|
||||
reloadable_patch do |plugin|
|
||||
::DraftSequence.plugin_ignore_draft_sequence_callbacks[plugin] = block
|
||||
end
|
||||
end
|
||||
|
||||
def listen_for(event_name)
|
||||
return unless self.respond_to?(event_name)
|
||||
DiscourseEvent.on(event_name, &self.method(event_name))
|
||||
|
Reference in New Issue
Block a user