Fix Users API Token API path (#526)

* Fix Users API Token API path

* Change CRLF to LF

* Fix route generation when route contains /api
This commit is contained in:
sephrat 2021-06-16 20:31:09 +02:00 committed by GitHub
parent f5ede73eb6
commit db3c8f7b4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -29,7 +29,7 @@ JS_DIR.mkdir(exist_ok=True, parents=True)
class RouteObject:
def __init__(self, route_string) -> None:
self.prefix = "/" + route_string.split("/")[1]
self.route = route_string.replace(self.prefix, "")
self.route = "/" + route_string.split("/", 2)[2]
self.js_route = self.route.replace("{", "${")
self.parts = route_string.split("/")[1:]
self.var = re.findall(r"\{(.*?)\}", route_string)