make request truthy if has transport (#1222)

This commit is contained in:
Raphael Deem
2018-05-16 14:12:12 -07:00
committed by GitHub
parent e1c9020268
commit 202a4c6525

View File

@@ -78,6 +78,11 @@ class Request(dict):
self.method, self.method,
self.path) self.path)
def __bool__(self):
if self.transport:
return True
return False
@property @property
def json(self): def json(self):
if self.parsed_json is None: if self.parsed_json is None: