Skip to content

Commit

Permalink
Fix issue in VoiceOver uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
Shruti1229 committed Nov 27, 2023
1 parent d5ea2da commit d64830d
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions backend/video/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,15 @@ def get_video_func(request):
organization = project.organization_id
if create:
videos = Video.objects.filter(url=url)
for video_organization in videos.values_list("project_id__organization_id__id", flat=True):
for video_organization in videos.values_list(
"project_id__organization_id__id", flat=True
):
if video_organization == organization.id:
video = Video.objects.filter(url=url).filter(project_id__organization_id__id=organization.id).first()
video = (
Video.objects.filter(url=url)
.filter(project_id__organization_id__id=organization.id)
.first()
)
return Response(
{
"message": "Video is already a part of project -> {}.".format(
Expand All @@ -267,6 +273,15 @@ def get_video_func(request):
},
status=status.HTTP_400_BAD_REQUEST,
)

video = (
Video.objects.filter(url=url)
.filter(project_id__organization_id__id=organization.id)
.first()
)
if video is None:
create = True

# Convert audio only to boolean
is_audio_only = is_audio_only.lower() == "true"
multiple_speaker = multiple_speaker.lower() == "true"
Expand Down Expand Up @@ -713,7 +728,7 @@ def create_video(
new_request.GET["task_description"] = task_description
new_request.GET["description"] = video_description
new_request.GET["ETA"] = ETA
new_request.GET["create"] = "true"
new_request.GET["create"] = "false"
new_request.GET["gender"] = gender
new_request.GET["assignee"] = assignee
new_request.GET["task_type"] = task_type
Expand Down

0 comments on commit d64830d

Please sign in to comment.