diff options
author | 2020-12-16 10:28:52 +0000 | |
---|---|---|
committer | 2020-12-16 10:28:52 +0000 | |
commit | 2c5610d1dbf5d6e8fb112d9dc4d93330a87c6708 (patch) | |
tree | 78b7f2269ef04da0f9c3f871ac45a00cf14ca3f6 /backend/route.py | |
parent | Merge pull request #33 from python-discord/renovate/uvicorn-0.x (diff) | |
parent | Merge branch 'main' into ks123/routes-parsing (diff) |
Merge pull request #28 from python-discord/ks123/routes-parsing
Diffstat (limited to 'backend/route.py')
-rw-r--r-- | backend/route.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/route.py b/backend/route.py index eb69ebc..d778bf0 100644 --- a/backend/route.py +++ b/backend/route.py @@ -5,13 +5,13 @@ from starlette.endpoints import HTTPEndpoint class Route(HTTPEndpoint): - name: str = None - path: str = None + name: str + path: str @classmethod - def check_parameters(cls) -> "Route": - if cls.name is None: + def check_parameters(cls) -> None: + if not hasattr(cls, "name"): raise ValueError(f"Route {cls.__name__} has not defined a name") - if cls.path is None: + if not hasattr(cls, "path"): raise ValueError(f"Route {cls.__name__} has not defined a path") |