FIX: Only seed general category on new sites (#18130)

* FIX: Only seed general category on new sites

If the site already has human users (users with an id > 0) don't seed
the categories.

Follow up to: a6ad74c759f8e4f785dbcdb38c05f78d43c4128f

* use human_users scope
This commit is contained in:
Blake Erickson
2022-08-29 18:23:14 -06:00
committed by GitHub
parent b58d168f05
commit 00539307e1
2 changed files with 18 additions and 0 deletions

View File

@ -128,6 +128,8 @@ module SeedData
end
def should_create_category?(category_id, force_existence)
return false if User.human_users.any?
if category_id > 0
force_existence ? !Category.exists?(category_id) : false
else