Fix credo issues

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-06-14 18:15:27 +02:00
parent ca36dd12e2
commit a007764d27
17 changed files with 267 additions and 44 deletions

View File

@@ -83,13 +83,13 @@ defmodule EventosWeb.ActivityPubController do
def inbox(conn, params) do
headers = Enum.into(conn.req_headers, %{})
if !String.contains?(headers["signature"] || "", params["actor"]) do
Logger.info("Signature not from author, relayed message, fetching from source")
ActivityPub.fetch_event_from_url(params["object"]["id"])
else
if String.contains?(headers["signature"] || "", params["actor"]) do
Logger.info("Signature error")
Logger.info("Could not validate #{params["actor"]}")
Logger.info(inspect(conn.req_headers))
else
Logger.info("Signature not from author, relayed message, fetching from source")
ActivityPub.fetch_event_from_url(params["object"]["id"])
end
json(conn, "ok")

View File

@@ -60,7 +60,7 @@ defmodule EventosWeb.EventController do
end
def export_to_ics(conn, %{"uuid" => uuid}) do
event = Events.get_event_full_by_uuid(uuid) |> ICalendar.export_event()
event = uuid |> Events.get_event_full_by_uuid() |> ICalendar.export_event()
send_resp(conn, 200, event)
end