Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🎨(backend) use object primary key instead of id attribute

lebaudantoine888fbbcd5f64
diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py
index 0bf90c27..b41ce739 100644
--- a/src/backend/core/api/viewsets.py
+++ b/src/backend/core/api/viewsets.py
@@ -584,7 +584,7 @@ class RoomViewSet(
try:
ParticipantsManagement().mute(
- room_name=str(room.id),
+ room_name=str(room.pk),
identity=str(serializer.validated_data["participant_identity"]),
track_sid=serializer.validated_data["track_sid"],
)
@@ -617,7 +617,7 @@ class RoomViewSet(
try:
ParticipantsManagement().update(
- room_name=str(room.id),
+ room_name=str(room.pk),
identity=str(serializer.validated_data["participant_identity"]),
metadata=serializer.validated_data.get("metadata"),
attributes=serializer.validated_data.get("attributes"),
@@ -653,7 +653,7 @@ class RoomViewSet(
try:
ParticipantsManagement().remove(
- room_name=str(room.id),
+ room_name=str(room.pk),
identity=str(serializer.validated_data["participant_identity"]),
)
except ParticipantsManagementException:
diff --git a/src/backend/core/services/telephony.py b/src/backend/core/services/telephony.py
index efdd43a1..b5d622bc 100644
--- a/src/backend/core/services/telephony.py
+++ b/src/backend/core/services/telephony.py
@@ -38,12 +38,12 @@ class TelephonyService:
direct_rule = SIPDispatchRule(
dispatch_rule_direct=SIPDispatchRuleDirect(
- room_name=str(room.id), pin=str(room.pin_code)
+ room_name=str(room.pk), pin=str(room.pin_code)
)
)
request = CreateSIPDispatchRuleRequest(
- rule=direct_rule, name=self._rule_name(room.id)
+ rule=direct_rule, name=self._rule_name(room.pk)
)
lkapi = utils.create_livekit_client()
diff --git a/src/backend/core/tests/services/test_lobby.py b/src/backend/core/tests/services/test_lobby.py
index 43f745de..ce7746c7 100644
--- a/src/backend/core/tests/services/test_lobby.py
+++ b/src/backend/core/tests/services/test_lobby.py
@@ -450,7 +450,7 @@ def test_enter_success(
timeout=settings.LOBBY_WAITING_TIMEOUT,
)
mock_notify.assert_called_once_with(
- room_name=str(room.id), notification_data={"type": "participantWaiting"}
+ room_name=str(room.pk), notification_data={"type": "participantWaiting"}
)