mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
quick fix participant get create
This commit is contained in:
@@ -152,6 +152,7 @@ class Transcript(BaseModel):
|
|||||||
self.topics.append(topic)
|
self.topics.append(topic)
|
||||||
|
|
||||||
def upsert_participant(self, participant: TranscriptParticipant):
|
def upsert_participant(self, participant: TranscriptParticipant):
|
||||||
|
if self.participants:
|
||||||
index = next(
|
index = next(
|
||||||
(i for i, p in enumerate(self.participants) if p.id == participant.id),
|
(i for i, p in enumerate(self.participants) if p.id == participant.id),
|
||||||
None,
|
None,
|
||||||
@@ -160,6 +161,8 @@ class Transcript(BaseModel):
|
|||||||
self.participants[index] = participant
|
self.participants[index] = participant
|
||||||
else:
|
else:
|
||||||
self.participants.append(participant)
|
self.participants.append(participant)
|
||||||
|
else:
|
||||||
|
self.participants = [participant]
|
||||||
return participant
|
return participant
|
||||||
|
|
||||||
def delete_participant(self, participant_id: str):
|
def delete_participant(self, participant_id: str):
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ async def transcript_add_participant(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# ensure the speaker is unique
|
# ensure the speaker is unique
|
||||||
|
if transcript.participants:
|
||||||
for p in transcript.participants:
|
for p in transcript.participants:
|
||||||
if p.speaker == participant.speaker:
|
if p.speaker == participant.speaker:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
7
server/transcript-snippet.sql
Normal file
7
server/transcript-snippet.sql
Normal file
File diff suppressed because one or more lines are too long
24
server/transcript.sql
Normal file
24
server/transcript.sql
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user