Browse Source

Wrappers: Add defaults to Request properties

- Otherwise return property object reference if logic fails
pull/2922/head
stephen-st 6 years ago
parent
commit
42d3d32b0b
  1. 4
      flask/wrappers.py

4
flask/wrappers.py

@ -154,14 +154,14 @@ class Request(RequestBase, JSONMixin):
modified URL. If an exception happened when matching, this will
be ``None``.
"""
if self.url_rule is not None:
return self.url_rule.endpoint
return self.url_rule.endpoint if self.url_rule else None
@property
def blueprint(self):
"""The name of the current blueprint"""
if self.url_rule and '.' in self.url_rule.endpoint:
return self.url_rule.endpoint.rsplit('.', 1)[0]
return ''
def _load_form_data(self):
RequestBase._load_form_data(self)

Loading…
Cancel
Save