Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
463B

  1. defmodule Mix.Tasks.RegisterUser do
  2. use Mix.Task
  3. import Mix.Ecto
  4. alias Pleroma.{Repo, User}
  5. @shortdoc "Register user"
  6. def run([name, nickname, email, bio, password]) do
  7. ensure_started(Repo, [])
  8. params = %{
  9. name: name,
  10. nickname: nickname,
  11. email: email,
  12. password: password,
  13. password_confirmation: password,
  14. bio: bio
  15. }
  16. user = User.register_changeset(%User{}, params)
  17. Repo.insert!(user)
  18. end
  19. end