aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink0ff <juri@linkov.net>2018-12-16 18:25:31 +0200
committerlink0ff <juri@linkov.net>2018-12-16 18:25:31 +0200
commit22d483d4f74ff404fd6ae0cd88d2e5bcc7cceaf6 (patch)
tree949110f6c07e35ec7da836328a95ba41393b237d
parent7c235b8874d575cb1582b1fca2817a8db492bf4c (diff)
downloadpleroma-22d483d4f74ff404fd6ae0cd88d2e5bcc7cceaf6.tar.gz
Use bindings dbuser and dbname in sample_psql.eex
-rw-r--r--lib/mix/tasks/pleroma/sample_psql.eex6
-rw-r--r--lib/mix/tasks/pleroma/user.ex18
2 files changed, 11 insertions, 13 deletions
diff --git a/lib/mix/tasks/pleroma/sample_psql.eex b/lib/mix/tasks/pleroma/sample_psql.eex
index c89b34ef2..f0ac05e57 100644
--- a/lib/mix/tasks/pleroma/sample_psql.eex
+++ b/lib/mix/tasks/pleroma/sample_psql.eex
@@ -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;
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex
index fe6e6935f..3d30e3a81 100644
--- a/lib/mix/tasks/pleroma/user.ex
+++ b/lib/mix/tasks/pleroma/user.ex
@@ -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)