Skip to content

Commit

Permalink
fixes for paraphrase
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikvirendrar committed Sep 5, 2024
1 parent 1bc5fbc commit e902acd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

DOMAIN = os.getenv("DOMAIN")
SITE_NAME = os.getenv("DOMAIN")
PROTOCOL = "https"

DJOSER = {
"PASSWORD_RESET_CONFIRM_URL": "forget-password/confirm/{uid}/{token}",
Expand Down
2 changes: 1 addition & 1 deletion backend/newsletter/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def celery_newsletter_call(newsletter_id, subject):
unsubscribe_link = f"{frontend_url}/#/newsletter/unsubscribe?email={subscribed_user.email}&categories={subscribed_categories}"
cont = newsletter.content.replace("{unsubscribe_link}", unsubscribe_link)
try:
subject = "Reset Password Link For Shoonya"
subject = "Chitralekha Newsletter"
message = f"<p> Hello! Please click on the following link to view the newsletter {cont} </p>"

compiled_code = send_email_template(subject, message)
Expand Down
14 changes: 7 additions & 7 deletions backend/transcript/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ def update_transcript(i, start_offset, payload, transcript):
}


def modify_payload(offset, limit, payload, start_offset, end_offset, transcript, complete=False):
def modify_payload(offset, limit, payload, start_offset, end_offset, transcript):
count_sentences = len(transcript.payload["payload"])
total_pages = math.ceil(len(transcript.payload["payload"]) / int(limit))
if (
Expand Down Expand Up @@ -1425,11 +1425,6 @@ def modify_payload(offset, limit, payload, start_offset, end_offset, transcript,
delete_indices.reverse()
for ind in delete_indices:
transcript.payload["payload"].pop(ind)
if complete:
for item in transcript.payload["payload"]:
item['verbatim_text'] = item.pop('text')
item['text'] = item['paraphrased_text']


@swagger_auto_schema(
method="post",
Expand Down Expand Up @@ -1881,8 +1876,10 @@ def save_transcription(request):
start_offset,
end_offset,
transcript_obj,
True
)
for item in transcript_obj.payload["payload"]:
item['verbatim_text'] = item.pop('text')
item['text'] = item['paraphrased_text']
transcript_obj.save()
task.status = "COMPLETE"
task.save()
Expand Down Expand Up @@ -1994,6 +1991,9 @@ def save_transcription(request):
end_offset,
transcript_obj,
)
for item in transcript_obj.payload["payload"]:
item['verbatim_text'] = item.pop('text')
item['text'] = item['paraphrased_text']
transcript_obj.save()
task.status = "COMPLETE"
task.save()
Expand Down

0 comments on commit e902acd

Please sign in to comment.