diff --git a/src/character/models/character.py b/src/character/models/character.py
index e811e9d..cc87a94 100644
--- a/src/character/models/character.py
+++ b/src/character/models/character.py
@@ -90,7 +90,9 @@ class CharacterQuerySet(models.QuerySet):
from party.models import Party
return self.filter(
- Q(player=user) | Q(parties__in=Party.objects.related_to(user))
+ Q(player=user)
+ | Q(parties__in=Party.objects.related_to(user))
+ | Q(invites__in=Party.objects.related_to(user))
)
diff --git a/src/character/templates/character/snippets/characters_list/character_card.html b/src/character/templates/character/snippets/characters_list/character_card.html
index 1965269..59a0a53 100644
--- a/src/character/templates/character/snippets/characters_list/character_card.html
+++ b/src/character/templates/character/snippets/characters_list/character_card.html
@@ -60,11 +60,11 @@
{% endif %}
{% elif character|managed_by:user %}
-
+
GĂ©rer
{% else %}
-
+
Observer
{% endif %}
diff --git a/src/party/tests/test_interactions.py b/src/party/tests/test_interactions.py
index c891e9c..406195e 100644
--- a/src/party/tests/test_interactions.py
+++ b/src/party/tests/test_interactions.py
@@ -37,3 +37,30 @@ def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveS
assert selenium.current_url == live_server.url + reverse("party:list")
party.refresh_from_db()
assert set(party.invited_characters.all()) == {character}
+
+
+@pytest.mark.django_db
+def test_gm_observe_invited_character_in_group(
+ selenium: WebDriver, live_server: LiveServer
+):
+ call_command("loaddata", "initial_data")
+
+ username, password = "gm", "password"
+ gm = User.objects.create_user(username, password=password)
+ player = User.objects.create_user("player")
+ party = baker.make(Party, game_master=gm)
+ character = baker.make(Character, player=player)
+ party.invited_characters.add(character)
+
+ selenium.get(live_server.url)
+ login(selenium, username, password)
+
+ selenium.get(live_server.url + reverse("party:list"))
+ selenium.find_element(
+ By.CSS_SELECTOR, f".party[data-id='{party.pk}'] .access"
+ ).click()
+ selenium.find_element(
+ By.CSS_SELECTOR, f".character[data-id='{character.pk}'] .observe"
+ ).click()
+ title = selenium.find_element(By.TAG_NAME, "h1").text.strip()
+ assert title == character.name