Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ckend into custom-auth
  • Loading branch information
ZoroZoro95 committed Oct 1, 2024
2 parents 03836b9 + 0364451 commit f62dd2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,6 @@ def create_bulk_projects(self, request, pk=None, *args, **kwargs):

data_list = project_data["managers"].value
managers_id = [user_dict["id"] for user_dict in data_list]

for title in titles:
project_data_1 = {
"title": title,
Expand All @@ -1024,6 +1023,7 @@ def create_bulk_projects(self, request, pk=None, *args, **kwargs):
"video_integration": project_data["video_integration"].value,
"default_task_description": project_data["default_description"].value,
"description": project_data["description"].value,
"paraphrase_enabled":project_data["paraphrasing_enabled"].value
}
# Create a request object with the necessary dat
new_request = HttpRequest()
Expand Down
4 changes: 2 additions & 2 deletions backend/transcript/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ def retrieve_all_transcriptions(request):
"id": transcript.id,
"status": transcript.status,
"transcript_type": transcript.transcript_type,
"video": transcript.video.video_uuid,
"video": transcript.video.pk,
"language": transcript.language,
"task": transcript.task.task_uuid,
"task": transcript.task.pk,
"user": (
transcript.user.username if transcript.user else "No user associated"
),
Expand Down
6 changes: 5 additions & 1 deletion backend/video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,11 @@ def upload_csv_org(request):
{"message": "Organization not found"}, status=status.HTTP_404_NOT_FOUND
)

if not org.organization_owners.filter(id=request.user.id).exists():
is_owner = org.organization_owners.filter(id=request.user.id).exists()

is_manager = request.user.role == "PROJECT_MANAGER" and request.user.organization.id == org_id

if not (is_owner or is_manager ):
return Response(
{"message": "You are not allowed to upload CSV."},
status=status.HTTP_403_FORBIDDEN,
Expand Down

0 comments on commit f62dd2d

Please sign in to comment.