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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user