fix tests
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details

This commit is contained in:
FloatingGhost 2022-07-27 22:18:25 +01:00
parent 7c3e3b50fd
commit f036674fff
2 changed files with 16 additions and 4 deletions

View File

@ -50,6 +50,21 @@ pipeline:
- mix local.rebar --force
- mix format --check-formatted
build:
image: akkoma/ci-base:latest
<<: *on-pr-open
environment:
MIX_ENV: test
POSTGRES_DB: pleroma_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
commands:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
test:
image: akkoma/ci-base:latest
<<: *on-pr-open

View File

@ -663,8 +663,6 @@ defmodule Pleroma.User do
# Used to auto-register LDAP accounts which won't have a password hash stored locally
def register_changeset_ldap(struct, params = %{password: password})
when is_nil(password) do
params = Map.put_new(params, :accepts_chat_messages, true)
params =
if Map.has_key?(params, :email) do
Map.put_new(params, :email, params[:email])
@ -676,8 +674,7 @@ defmodule Pleroma.User do
|> cast(params, [
:name,
:nickname,
:email,
:accepts_chat_messages
:email
])
|> validate_required([:name, :nickname])
|> unique_constraint(:nickname)