Skip to content

Commit

Permalink
Fix PTH118 os.path.join() should be replaced by Path with / ope…
Browse files Browse the repository at this point in the history
…rator
  • Loading branch information
brianhelba committed Nov 9, 2023
1 parent ec0c1f1 commit 93be944
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dandiapi/api/asset_paths.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import os
from typing import TYPE_CHECKING

from django.db import IntegrityError, transaction
Expand All @@ -26,7 +25,7 @@
def extract_paths(path: str) -> list[str]:
nodepaths: list[str] = path.split('/')
for i in range(len(nodepaths))[1:]:
nodepaths[i] = os.path.join(nodepaths[i - 1], nodepaths[i])
nodepaths[i] = f'{nodepaths[i - 1]}/{nodepaths[i]}'

return nodepaths

Expand Down
4 changes: 1 addition & 3 deletions dandiapi/api/views/info.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from django.conf import settings
from drf_yasg.utils import no_body, swagger_auto_schema
from rest_framework import serializers
Expand Down Expand Up @@ -56,7 +54,7 @@ def __init__(self, *args, **kwargs):
)
@api_view()
def info_view(self):
api_url = os.path.join(settings.DANDI_API_URL, 'api')
api_url = f'{settings.DANDI_API_URL}/api'
serializer = ApiInfoSerializer(
data={
'schema_version': settings.DANDI_SCHEMA_VERSION,
Expand Down

0 comments on commit 93be944

Please sign in to comment.