From af1781dcd0c7d566b79d2a5b9fc408fb127dd06e Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 15 Dec 2019 21:24:23 -0500 Subject: [PATCH] fix warnings --- lib/philomena/users.ex | 1 - lib/philomena_web/templates/admin/user/_form.html.slime | 6 +++--- lib/philomena_web/views/admin/user_view.ex | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/philomena/users.ex b/lib/philomena/users.ex index b2a869b9..90797e00 100644 --- a/lib/philomena/users.ex +++ b/lib/philomena/users.ex @@ -57,7 +57,6 @@ defmodule Philomena.Users do """ def create_user(attrs \\ %{}) do - roles = %User{} |> User.changeset(attrs) |> Repo.insert() diff --git a/lib/philomena_web/templates/admin/user/_form.html.slime b/lib/philomena_web/templates/admin/user/_form.html.slime index 4d9c06d8..4179071e 100644 --- a/lib/philomena_web/templates/admin/user/_form.html.slime +++ b/lib/philomena_web/templates/admin/user/_form.html.slime @@ -29,16 +29,16 @@ .block .block__header span.block__header__title General user flags - ul = collection_checkboxes f, :roles, filtered_roles(general_permissions, @roles), mapper: &checkbox_mapper/6 + ul = collection_checkboxes f, :roles, filtered_roles(general_permissions(), @roles), mapper: &checkbox_mapper/6 .block .block__header.warning span.block__header__title Special roles for assistants - ul = collection_checkboxes f, :roles, filtered_roles(assistant_permissions, @roles), mapper: &checkbox_mapper/6 + ul = collection_checkboxes f, :roles, filtered_roles(assistant_permissions(), @roles), mapper: &checkbox_mapper/6 .block .block__header.danger span.block__header__title Special roles for moderators - ul = collection_checkboxes f, :roles, filtered_roles(moderator_permissions, @roles), mapper: &checkbox_mapper/6 + ul = collection_checkboxes f, :roles, filtered_roles(moderator_permissions(), @roles), mapper: &checkbox_mapper/6 = submit "Save User", class: "button" diff --git a/lib/philomena_web/views/admin/user_view.ex b/lib/philomena_web/views/admin/user_view.ex index 25c54f75..dc8c9a3f 100644 --- a/lib/philomena_web/views/admin/user_view.ex +++ b/lib/philomena_web/views/admin/user_view.ex @@ -1,7 +1,7 @@ defmodule PhilomenaWeb.Admin.UserView do use PhilomenaWeb, :view - def checkbox_mapper(form, field, input_opts, role, label_opts, _opts) do + def checkbox_mapper(form, field, input_opts, role, _label_opts, _opts) do input_id = "user_roles_#{role.id}" label_opts = [for: input_id] input_opts = @@ -24,13 +24,12 @@ defmodule PhilomenaWeb.Admin.UserView do def description("moderator", "Image"), do: "Manage images" def description("moderator", "DuplicateReport"), do: "Manage duplicates" def description("moderator", "Comment"), do: "Manage comments" - def description("moderator", "Tag"), do: "Manage tag details" def description("moderator", "UserLink"), do: "Manage user links" def description("moderator", "Topic"), do: "Moderate forums" + def description("moderator", "Tag"), do: "Manage tag details" def description("admin", "Tag"), do: "Alias tags" def description("batch_update", "Tag"), do: "Update tags in batches" - def description("moderator", "Tag"), do: "Manage tags" def description("moderator", "User"), do: "Manage users and wipe votes" def description("admin", "Role"), do: "Manage permissions"