aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-10-31 17:36:59 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-10-31 17:38:12 +0300
commit1b3a942a84b8b612e07e3bf34801137741926911 (patch)
treefcd4ac881fa3809577c972ffc73eebf6e76c38de
parent58da7f66202f3f2e90d4954649c3e5a0e3a7dc32 (diff)
downloadpleroma-1b3a942a84b8b612e07e3bf34801137741926911.tar.gz
fix format
-rw-r--r--lib/mix/tasks/pleroma/marker.ex10
-rw-r--r--test/web/mastodon_api/controllers/marker_controller_test.exs18
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/mix/tasks/pleroma/marker.ex b/lib/mix/tasks/pleroma/marker.ex
index 1d5be11de..bebef0d6a 100644
--- a/lib/mix/tasks/pleroma/marker.ex
+++ b/lib/mix/tasks/pleroma/marker.ex
@@ -1,10 +1,10 @@
defmodule Mix.Tasks.Pleroma.Marker do
use Mix.Task
import Mix.Pleroma
-
import Ecto.Query
- alias Pleroma.Repo
+
alias Pleroma.Notification
+ alias Pleroma.Repo
def run(["update_markers"]) do
start_pleroma()
@@ -15,7 +15,7 @@ defmodule Mix.Tasks.Pleroma.Marker do
user_id: q.user_id,
unread_count: fragment("SUM( CASE WHEN seen = false THEN 1 ELSE 0 END )"),
last_read_id:
- type(fragment("MAX( CASE WHEN seen = true THEN id ELSE null END )"), :string)
+ type(fragment("MAX( CASE WHEN seen = true THEN id ELSE null END )"), :string)
},
group_by: [q.user_id]
)
@@ -26,8 +26,8 @@ defmodule Mix.Tasks.Pleroma.Marker do
|> Ecto.Changeset.change()
|> Pleroma.Repo.insert(
returning: true,
- on_conflict: {:replace, [:last_read_id, :unread_count]},
- conflict_target: [:user_id, :timeline]
+ on_conflict: {:replace, [:last_read_id, :unread_count]},
+ conflict_target: [:user_id, :timeline]
)
end)
diff --git a/test/web/mastodon_api/controllers/marker_controller_test.exs b/test/web/mastodon_api/controllers/marker_controller_test.exs
index e0aacccb4..8bcfcb7e1 100644
--- a/test/web/mastodon_api/controllers/marker_controller_test.exs
+++ b/test/web/mastodon_api/controllers/marker_controller_test.exs
@@ -26,13 +26,13 @@ defmodule Pleroma.Web.MastodonAPI.MarkerControllerTest do
|> json_response(200)
assert response == %{
- "notifications" => %{
- "last_read_id" => "69420",
- "updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
- "version" => 0,
- "pleroma" => %{ "unread_count" => 7 }
- }
- }
+ "notifications" => %{
+ "last_read_id" => "69420",
+ "updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
+ "version" => 0,
+ "pleroma" => %{"unread_count" => 7}
+ }
+ }
end
test "gets markers with missed scopes", %{conn: conn} do
@@ -72,7 +72,7 @@ defmodule Pleroma.Web.MastodonAPI.MarkerControllerTest do
"last_read_id" => "69420",
"updated_at" => _,
"version" => 0,
- "pleroma" => %{ "unread_count" => 0 }
+ "pleroma" => %{"unread_count" => 0}
}
} = response
end
@@ -102,7 +102,7 @@ defmodule Pleroma.Web.MastodonAPI.MarkerControllerTest do
"last_read_id" => "69888",
"updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
"version" => 0,
- "pleroma" => %{ "unread_count" => 0 }
+ "pleroma" => %{"unread_count" => 0}
}
}
end