aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2018-12-20 12:55:12 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2018-12-20 12:55:12 +0300
commit501ce34d7fbb74f91e8afcaa491625c5a0152597 (patch)
treeb37c963b560b24f50adc5d5aab06c41cc423b0db
parentb520d44b58db3bac7a883c2220d83d05b07784d0 (diff)
downloadpleroma-501ce34d7fbb74f91e8afcaa491625c5a0152597.tar.gz
[#114] Stylistic adjustments.
-rw-r--r--lib/pleroma/user.ex15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 7e792cb0c..7e3a342f1 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -76,15 +76,14 @@ defmodule Pleroma.User do
def user_info(%User{} = user) do
oneself = if user.local, do: 1, else: 0
- user_info = user.info
%{
following_count: length(user.following) - oneself,
- note_count: user_info.note_count,
- follower_count: user_info.follower_count,
- locked: user_info.locked,
- confirmation_pending: user_info.confirmation_pending,
- default_scope: user_info.default_scope
+ note_count: user.info.note_count,
+ follower_count: user.info.follower_count,
+ locked: user.info.locked,
+ confirmation_pending: user.info.confirmation_pending,
+ default_scope: user.info.default_scope
}
end
@@ -182,6 +181,8 @@ defmodule Pleroma.User do
:unconfirmed
end
+ info_change = User.Info.confirmation_changeset(%User.Info{}, confirmation_status)
+
changeset =
struct
|> cast(params, [:bio, :email, :name, :nickname, :password, :password_confirmation])
@@ -193,7 +194,7 @@ defmodule Pleroma.User do
|> validate_format(:email, @email_regex)
|> validate_length(:bio, max: 1000)
|> validate_length(:name, min: 1, max: 100)
- |> put_change(:info, User.Info.confirmation_changeset(%User.Info{}, confirmation_status))
+ |> put_change(:info, info_change)
if changeset.valid? do
hashed = Pbkdf2.hashpwsalt(changeset.changes[:password])