Skip to content

Commit

Permalink
Updated issue changing to only alter phrase (and speaker) if entered …
Browse files Browse the repository at this point in the history
…info differs from what's already in the record (transcription/speaker code): Helpful for when there's multiple entries with the same transcription
  • Loading branch information
fbanados committed Oct 11, 2024
1 parent 0ee922a commit 1370706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions validation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,12 +1645,12 @@ def handle_save_issue_with_recording(form, issue, request, language):
rec = Recording.objects.get(id=issue.recording.id)

speaker_code = form.cleaned_data["speaker"]
if speaker_code:
if speaker_code and (not rec.speaker or rec.speaker.code != speaker_code):
speaker = Speaker.objects.get(code=speaker_code)
rec.speaker = speaker

new_word = form.cleaned_data["phrase"].strip()
if new_word:
if new_word and (not rec.phrase or rec.phrase.transcription != new_word):
new_phrase = Phrase.objects.filter(transcription=new_word).first()
if not new_phrase:
new_phrase = Phrase(
Expand Down

0 comments on commit 1370706

Please sign in to comment.