Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
balanza committed Oct 22, 2024
1 parent b522d73 commit ce8005c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 1 addition & 8 deletions lib/trento/activity_logging/parser/metadata_enricher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Trento.ActivityLog.Logger.Parser.MetadataEnricher do
_ -> metadata
end

{activity, clean_metadata(enriched_metadata)}
{activity, enriched_metadata}
end

defp detect_enrichment(
Expand Down Expand Up @@ -84,11 +84,4 @@ defmodule Trento.ActivityLog.Logger.Parser.MetadataEnricher do

defp detect_enrichment(_target_entity, {_activity, _metadata}),
do: {:error, :no_enrichment_needed}

defp clean_metadata(%{username: username} = metadata) do
clean_username = username |> String.split("__") |> List.first()
Map.put(metadata, :username, clean_username)
end

defp clean_metadata(metadata), do: metadata
end
2 changes: 1 addition & 1 deletion lib/trento/users.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Trento.Users do

alias Trento.Users.User

@spec by_id(id :: integer) :: {:ok, User.t()} | {:error, :not_found}
@spec by_id(id :: non_neg_integer()) :: {:ok, User.t()} | {:error, :not_found}
def by_id(id) do
case Repo.get(User, id) do
%User{} = user -> {:ok, user}
Expand Down
2 changes: 2 additions & 0 deletions lib/trento/users/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ defmodule Trento.Users.User do
@sequences ["01234567890", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
@max_sequential_chars 3

@type t :: %__MODULE__{}

schema "users" do
pow_user_fields()

Expand Down

0 comments on commit ce8005c

Please sign in to comment.