🎨(backend) use object primary key instead of id attribute
Replace id attribute references with object primary key for better code consistency and Django model conventions. requested by @qbey
This commit is contained in:
committed by
aleb_the_flash
parent
9b6b32c3d5
commit
888fbbcd5f
@@ -584,7 +584,7 @@ class RoomViewSet(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
ParticipantsManagement().mute(
|
ParticipantsManagement().mute(
|
||||||
room_name=str(room.id),
|
room_name=str(room.pk),
|
||||||
identity=str(serializer.validated_data["participant_identity"]),
|
identity=str(serializer.validated_data["participant_identity"]),
|
||||||
track_sid=serializer.validated_data["track_sid"],
|
track_sid=serializer.validated_data["track_sid"],
|
||||||
)
|
)
|
||||||
@@ -617,7 +617,7 @@ class RoomViewSet(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
ParticipantsManagement().update(
|
ParticipantsManagement().update(
|
||||||
room_name=str(room.id),
|
room_name=str(room.pk),
|
||||||
identity=str(serializer.validated_data["participant_identity"]),
|
identity=str(serializer.validated_data["participant_identity"]),
|
||||||
metadata=serializer.validated_data.get("metadata"),
|
metadata=serializer.validated_data.get("metadata"),
|
||||||
attributes=serializer.validated_data.get("attributes"),
|
attributes=serializer.validated_data.get("attributes"),
|
||||||
@@ -653,7 +653,7 @@ class RoomViewSet(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
ParticipantsManagement().remove(
|
ParticipantsManagement().remove(
|
||||||
room_name=str(room.id),
|
room_name=str(room.pk),
|
||||||
identity=str(serializer.validated_data["participant_identity"]),
|
identity=str(serializer.validated_data["participant_identity"]),
|
||||||
)
|
)
|
||||||
except ParticipantsManagementException:
|
except ParticipantsManagementException:
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ class TelephonyService:
|
|||||||
|
|
||||||
direct_rule = SIPDispatchRule(
|
direct_rule = SIPDispatchRule(
|
||||||
dispatch_rule_direct=SIPDispatchRuleDirect(
|
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(
|
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()
|
lkapi = utils.create_livekit_client()
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ def test_enter_success(
|
|||||||
timeout=settings.LOBBY_WAITING_TIMEOUT,
|
timeout=settings.LOBBY_WAITING_TIMEOUT,
|
||||||
)
|
)
|
||||||
mock_notify.assert_called_once_with(
|
mock_notify.assert_called_once_with(
|
||||||
room_name=str(room.id), notification_data={"type": "participantWaiting"}
|
room_name=str(room.pk), notification_data={"type": "participantWaiting"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user