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 c5207c8

Browse files
fixed resource issues
1 parent 047e5c0 commit c5207c8

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

‎src/authorize/resources.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,13 @@ def path_to_resource() -> dict[str, str]:
7373

7474

7575
async def get_resource_name(path: str) -> str:
76-
_path = path
7776
path_dict = path_to_resource()
78-
while True:
77+
while path:
7978
try:
80-
resource = path_dict[_path]
81-
return resource
79+
return path_dict[path]
8280
except KeyError:
83-
new_path = "/".join(_path.split("/")[:-1])
84-
85-
if new_path == _path:
86-
raise KeyError(f"No Resource found for path: {path}")
87-
_path = new_path + "/"
88-
81+
path = "/".join(path.split("/")[:-1])
82+
return None
8983

9084
resource_name_request_size: dict[str, int] = {
9185

0 commit comments

Comments
(0)

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