fix a elixir warning

This commit is contained in:
Massedil
2025-10-27 17:33:18 +01:00
committed by setop
parent 488b89a26f
commit 249c5bf178

View File

@@ -160,18 +160,16 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
end
end
@doc """
A logged user that is banned stays logged-in.
We need to block the person creation to prevent the user to create new content
TODO: Best should be to destroy the session but it seems hard to do with token behaviour.
Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842
Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842#note_2255364
"""
def create_person(
_parent,
%{preferred_username: _preferred_username} = _args,
%{context: %{current_user: %{disabled: true} = _user} = _context} = _resolution
) do
# A logged user that is banned stays logged-in.
# We need to block the person creation to prevent the user to create new content
# TODO: Best should be to destroy the session but it seems hard to do with token behaviour.
# Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842
# Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842#note_2255364
{:error, :user_disabled}
end