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 4418275223
commit cc4a59ad1f
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
6 changed files with 10 additions and 12 deletions

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)