mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:48:18 +08:00
FEATURE: Extend PM recipient bulk imports (#27063)
* FIX: Support multiple topic allowed user imports * FEATURE: Add topic allowed groups import support
This commit is contained in:
@ -636,6 +636,8 @@ class BulkImport::Base
|
||||
|
||||
TOPIC_ALLOWED_USER_COLUMNS ||= %i[topic_id user_id created_at updated_at]
|
||||
|
||||
TOPIC_ALLOWED_GROUP_COLUMNS ||= %i[topic_id group_id created_at updated_at]
|
||||
|
||||
TOPIC_TAG_COLUMNS ||= %i[topic_id tag_id created_at updated_at]
|
||||
|
||||
TOPIC_USER_COLUMNS ||= %i[
|
||||
@ -879,6 +881,10 @@ class BulkImport::Base
|
||||
create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block)
|
||||
end
|
||||
|
||||
def create_topic_allowed_groups(rows, &block)
|
||||
create_records(rows, "topic_allowed_group", TOPIC_ALLOWED_GROUP_COLUMNS, &block)
|
||||
end
|
||||
|
||||
def create_topic_tags(rows, &block)
|
||||
create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block)
|
||||
end
|
||||
@ -1307,6 +1313,12 @@ class BulkImport::Base
|
||||
topic_allowed_user
|
||||
end
|
||||
|
||||
def process_topic_allowed_group(topic_allowed_group)
|
||||
topic_allowed_group[:created_at] = NOW
|
||||
topic_allowed_group[:updated_at] = NOW
|
||||
topic_allowed_group
|
||||
end
|
||||
|
||||
def process_topic_tag(topic_tag)
|
||||
topic_tag[:created_at] = NOW
|
||||
topic_tag[:updated_at] = NOW
|
||||
|
Reference in New Issue
Block a user