Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
paaragon committed Jan 16, 2025
1 parent 3caa089 commit e7fda82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions gateway/api/access_policies/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ def can_save_result(user, job: Job) -> bool:

has_access = user.id == job.author
if not has_access:
logger.warning(
"User [%s] has no access to job [%s].", user.id, job.author
)
logger.warning("User [%s] has no access to job [%s].", user.id, job.author)
return has_access
11 changes: 6 additions & 5 deletions gateway/api/views/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import json
import logging
import os
import time

from concurrency.exceptions import RecordModifiedError
from django.db.models import Q

# pylint: disable=duplicate-code
Expand Down Expand Up @@ -124,10 +122,13 @@ def result(self, request, pk=None): # pylint: disable=invalid-name,unused-argum

if not can_access:
return Response(
{"message": f"User [{author}] does not have permissions to access to job [{job.id}]."},
status=status.status.status.HTTP_403_FORBIDDEN,
{
"message": f"User [{author}] does not have permissions"
+ " to access to job [{job.id}]."
},
status=status.HTTP_403_FORBIDDEN,
)

result = json.dumps(request.data.get("result"))
result_storage = ResultStorage(author)
result_storage.save(job.id, result)
Expand Down

0 comments on commit e7fda82

Please sign in to comment.