1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 07:52:43 +00:00

Properly update event ics export cache and fix export desc html

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-14 15:44:16 +02:00
parent 32f6ee7019
commit cc701f8994
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
3 changed files with 8 additions and 6 deletions

View file

@ -298,6 +298,8 @@ defmodule Mobilizon.Events do
})
end
Cachex.del(:ics, "event_#{new_event.uuid}")
Mobilizon.Service.Events.Tool.calculate_event_diff_and_send_notifications(
old_event,
new_event,

View file

@ -8,7 +8,7 @@ defmodule MobilizonWeb.FeedController do
def actor(conn, %{"name" => name, "format" => "atom"}) do
case Cachex.fetch(:feed, "actor_" <> name) do
{:commit, data} ->
{status, data} when status in [:commit, :ok] ->
conn
|> put_resp_content_type("application/atom+xml")
|> send_resp(200, data)
@ -20,7 +20,7 @@ defmodule MobilizonWeb.FeedController do
def actor(conn, %{"name" => name, "format" => "ics"}) do
case Cachex.fetch(:ics, "actor_" <> name) do
{:commit, data} ->
{status, data} when status in [:commit, :ok] ->
conn
|> put_resp_content_type("text/calendar")
|> send_resp(200, data)
@ -32,7 +32,7 @@ defmodule MobilizonWeb.FeedController do
def event(conn, %{"uuid" => uuid, "format" => "ics"}) do
case Cachex.fetch(:ics, "event_" <> uuid) do
{:commit, data} ->
{status, data} when status in [:commit, :ok] ->
conn
|> put_resp_content_type("text/calendar")
|> send_resp(200, data)
@ -44,7 +44,7 @@ defmodule MobilizonWeb.FeedController do
def going(conn, %{"token" => token, "format" => "ics"}) do
case Cachex.fetch(:ics, "token_" <> token) do
{:commit, data} ->
{status, data} when status in [:commit, :ok] ->
conn
|> put_resp_content_type("text/calendar")
|> send_resp(200, data)
@ -56,7 +56,7 @@ defmodule MobilizonWeb.FeedController do
def going(conn, %{"token" => token, "format" => "atom"}) do
case Cachex.fetch(:feed, "token_" <> token) do
{:commit, data} ->
{status, data} when status in [:commit, :ok] ->
conn
|> put_resp_content_type("application/atom+xml")
|> send_resp(200, data)

View file

@ -29,7 +29,7 @@ defmodule Mobilizon.Service.Export.ICalendar do
dtstart: event.begins_on,
dtstamp: event.publish_at || DateTime.utc_now(),
dtend: event.ends_on,
description: event.description,
description: HtmlSanitizeEx.strip_tags(event.description),
uid: event.uuid,
categories: event.tags |> Enum.map(& &1.slug)
}