1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-10 09:02:50 +00:00

server - support for admin/mod users

This commit is contained in:
2018-01-16 21:48:46 -06:00
parent 744874ce4f
commit b30af0cd09
7 changed files with 77 additions and 5 deletions

View File

@@ -194,3 +194,18 @@ Enum.each(Category.get_seed(), fn(cat) ->
end
end)
end)
# insert admin user
accounts = Application.get_env(:myapp, :admin_accounts)
Enum.each(accounts, fn (user) ->
Repo.transaction(fn ->
exists = Repo.get_by(Data.User, %{username: Map.get(user, "username")}) != nil
if !exists do
MyApp.Data.User.insert_admin_user(user)
end
end)
end)