mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
wip(sync): only save Peer after authentication
This commit is contained in:
parent
a29eae138e
commit
698c74b427
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ async def application(scope, receive, send):
|
||||||
|
|
||||||
map_id = kwargs["map_id"]
|
map_id = kwargs["map_id"]
|
||||||
room_id = f"room{map_id}"
|
room_id = f"room{map_id}"
|
||||||
peer = await Peer.objects.acreate(uuid=uuid.uuid4(), name="FooBar", room_id=room_id)
|
peer = Peer(uuid=uuid.uuid4(), name="FooBar", room_id=room_id)
|
||||||
print(peer)
|
print(peer)
|
||||||
peer._send = send
|
peer._send = send
|
||||||
while True:
|
while True:
|
||||||
|
|
|
@ -115,7 +115,7 @@ class Peer(models.Model):
|
||||||
user, map_id, permissions = signed.values()
|
user, map_id, permissions = signed.values()
|
||||||
if "edit" not in permissions:
|
if "edit" not in permissions:
|
||||||
return await self.disconnect()
|
return await self.disconnect()
|
||||||
await Peer.asave()
|
await self.asave()
|
||||||
response = JoinResponse(uuid=str(self.uuid), peers=await self.get_peers())
|
response = JoinResponse(uuid=str(self.uuid), peers=await self.get_peers())
|
||||||
await self.send(response.model_dump_json())
|
await self.send(response.model_dump_json())
|
||||||
await self.send_peers_list()
|
await self.send_peers_list()
|
||||||
|
|
Loading…
Reference in a new issue