Use bindings dbuser and dbname in sample_psql.eex
authorlink0ff <juri@linkov.net>
Sun, 16 Dec 2018 16:25:31 +0000 (18:25 +0200)
committerlink0ff <juri@linkov.net>
Sun, 16 Dec 2018 16:25:31 +0000 (18:25 +0200)
lib/mix/tasks/pleroma/sample_psql.eex
lib/mix/tasks/pleroma/user.ex

index c89b34ef21bdd996866f4908628f34061485efde..f0ac05e5702bee70891f03b29d62e204e069aed8 100644 (file)
@@ -1,6 +1,6 @@
-CREATE USER pleroma WITH ENCRYPTED PASSWORD '<%= dbpass %>';
-CREATE DATABASE pleroma_dev OWNER pleroma;
-\c pleroma_dev;
+CREATE USER <%= dbuser %> WITH ENCRYPTED PASSWORD '<%= dbpass %>';
+CREATE DATABASE <%= dbname %> OWNER <%= dbuser %>;
+\c <%= dbname %>;
 --Extensions made by ecto.migrate that need superuser access
 CREATE EXTENSION IF NOT EXISTS citext;
 CREATE EXTENSION IF NOT EXISTS pg_trgm;
index fe6e6935f4fd5296db53e72985e25724ef0a33cd..3d30e3a81cfb10a3f3280cbedcf207ce80af420f 100644 (file)
@@ -94,16 +94,14 @@ defmodule Mix.Tasks.Pleroma.User do
     unless not proceed? do
       Common.start_pleroma()
 
-      params =
-        %{
-          nickname: nickname,
-          email: email,
-          password: password,
-          password_confirmation: password,
-          name: name,
-          bio: bio
-        }
-        |> IO.inspect()
+      params = %{
+        nickname: nickname,
+        email: email,
+        password: password,
+        password_confirmation: password,
+        name: name,
+        bio: bio
+      }
 
       user = User.register_changeset(%User{}, params)
       Repo.insert!(user)