mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Merge branch 'master' of https://github.com/discourse/discourse
This commit is contained in:
commit
033ca0e605
1 changed files with 3 additions and 2 deletions
|
@ -349,7 +349,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||||
|
|
||||||
@sequences[Badge.sequence_name] = last_id + 1
|
@sequences[Badge.sequence_name] = last_id + 1
|
||||||
|
|
||||||
copy_model(UserBadge, is_a_user_model: true, skip_if_merged: true)
|
copy_model(UserBadge, is_a_user_model: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def copy_model(klass, skip_if_merged: false, is_a_user_model: false, skip_processing: false, mapping: nil, select_sql: nil)
|
def copy_model(klass, skip_if_merged: false, is_a_user_model: false, skip_processing: false, mapping: nil, select_sql: nil)
|
||||||
|
@ -435,7 +435,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_topic(topic)
|
def process_topic(topic)
|
||||||
return nil if topic['category_id'].nil?
|
return nil if topic['category_id'].nil? && topic['archetype'] != Archetype.private_message
|
||||||
topic
|
topic
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -590,6 +590,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||||
def process_user_badge(user_badge)
|
def process_user_badge(user_badge)
|
||||||
user_badge['granted_by_id'] = user_id_from_imported_id(user_badge['granted_by_id']) if user_badge['granted_by_id']
|
user_badge['granted_by_id'] = user_id_from_imported_id(user_badge['granted_by_id']) if user_badge['granted_by_id']
|
||||||
user_badge['notification_id'] = notification_id_from_imported_id(user_badge['notification_id']) if user_badge['notification_id']
|
user_badge['notification_id'] = notification_id_from_imported_id(user_badge['notification_id']) if user_badge['notification_id']
|
||||||
|
return nil if UserBadge.where(user_id: user_badge['user_id'], badge_id: user_badge['badge_id']).exists?
|
||||||
user_badge
|
user_badge
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue