Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue in VoiceOver uploads #562

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading