Skip to content
Myr

Use a tuple to store _flashes, and simplify the flask.Request class.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by florentx · committed by Armin Ronacher · parent f014ce2 · Browse files · 1 file+3 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−7 removed

  • other:+3 added−7 removed

1 file+3 added−7 removed

modified:flask.py+3 added-7 removed
54 unmodified lines
55 the request object used you can subclass this and set56 :attr:`~flask.Flask.request_class` to your subclass.57 """5859 def __init__(self, environ):60 RequestBase.__init__(self, environ)61 self.endpoint = None62 self.view_args = None59 endpoint = view_args = None6061 @cached_property62 def json(self):63 """If the mimetype is `application/json` this will contain the
102 unmodified lines
166 the template has to call :func:`get_flashed_messages`.167168 :param message: the message to be flashed.169 """173 session['_flashes'] = (session.get('_flashes', [])) + [message]170 session['_flashes'] = session.get('_flashes', ()) + (message,)171172173def get_flashed_messages():174 """Pulls all flashed messages from the session and returns them.
1 unmodified line
176 the same messages.177 """178 flashes = _request_ctx_stack.top.flashes179 if flashes is None:183 _request_ctx_stack.top.flashes = flashes = \184 session.pop('_flashes', [])180 _request_ctx_stack.top.flashes = flashes = session.pop('_flashes', ())181 return flashes182183184def jsonify(*args, **kwargs):
617 unmodified lines