Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9d63234

Browse files
fixed resource issues
1 parent c5207c8 commit 9d63234

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/authorize/resources.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@ def path_to_resource() -> dict[str, str]:
7474

7575
async def get_resource_name(path: str) -> str:
7676
path_dict = path_to_resource()
77-
while path:
77+
i = 1
78+
while len(path.split("/")) > 2:
7879
try:
80+
print(path)
7981
return path_dict[path]
8082
except KeyError:
81-
path = "/".join(path.split("/")[:-1])
83+
path = "/".join(path.split("/")[:-i])
84+
i += 1
85+
path = f"{path}/"
8286
return None
8387

8488
resource_name_request_size: dict[str, int] = {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /