Run mix format and fix a credo check

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-09-09 09:35:50 +02:00
parent d3c3641d0a
commit ecd4675387
6 changed files with 10 additions and 12 deletions

View File

@ -8,7 +8,7 @@ defmodule Mobilizon.Actors.Member do
import Ecto.Changeset
alias Mobilizon.Actors.{Actor, Member, MemberRole}
@type t :: %__MODULE__{
role: MemberRole.t(),
parent: Actor.t(),

View File

@ -93,8 +93,7 @@ defmodule Mobilizon.Application do
def named_version, do: @name <> " " <> @version
def user_agent do
info =
"#{MobilizonWeb.Endpoint.url()} <#{Config.get([:instance, :email], "")}>"
info = "#{MobilizonWeb.Endpoint.url()} <#{Config.get([:instance, :email], "")}>"
named_version() <> "; " <> info
end

View File

@ -112,7 +112,8 @@ defmodule MobilizonWeb.Resolvers.User do
"""
@spec create_user(any(), map(), any()) :: tuple()
def create_user(_parent, args, _resolution) do
with {:registrations_open, true} <- {:registrations_open, Config.instance_registrations_open?()},
with {:registrations_open, true} <-
{:registrations_open, Config.instance_registrations_open?()},
{:ok, %User{} = user} <- Users.register(args) do
Activation.send_confirmation_email(user)
{:ok, user}

View File

@ -113,7 +113,6 @@ defmodule Mobilizon.Service.ActivityPub do
end
end
@doc """
Getting an actor from url, eventually creating it
"""

View File

@ -16,16 +16,17 @@ defmodule Mobilizon.Service.HTTPSignatures.Signature do
require Logger
def key_id_to_actor_url(key_id) do
%{path: path} = uri =
%{path: path} =
uri =
key_id
|> URI.parse()
|> Map.put(:fragment, nil)
uri =
if not is_nil(path) do
Map.put(uri, :path, String.trim_trailing(path, "/publickey"))
else
if is_nil(path) do
uri
else
Map.put(uri, :path, String.trim_trailing(path, "/publickey"))
end
URI.to_string(uri)

View File

@ -157,9 +157,7 @@ defmodule Mobilizon.ActorsTest do
event = insert(:event, organizer_actor: actor)
event_found_id =
Actors.get_actor_by_name_with_preload(
"#{actor.preferred_username}@#{actor.domain}"
).organized_events
Actors.get_actor_by_name_with_preload("#{actor.preferred_username}@#{actor.domain}").organized_events
|> hd
|> Map.get(:id)