aboutsummaryrefslogtreecommitdiffstats
path: root/backend/route.py
diff options
context:
space:
mode:
authorGravatar decorator-factory <[email protected]>2020-12-15 08:13:37 +0300
committerGravatar decorator-factory <[email protected]>2020-12-15 08:13:37 +0300
commit947a30f7406b7d025cf2e5754b59389af4213718 (patch)
treec6236edb812db32f583ac0acc9099be33d1a0e2b /backend/route.py
parentAdd ks123 (GH ks129) to CODEOWNERS (diff)
fix various type annotation issues
Diffstat (limited to 'backend/route.py')
-rw-r--r--backend/route.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/route.py b/backend/route.py
index eb69ebc..d8c38fc 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):
+ 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")