Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Traceback (most recent call last):
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1610, in full_dispatch_request
rv = self.preprocess_request()
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/flask/app.py", line 1831, in preprocess_request
rv = func()
File "/projects/flask-mega-tutorial/app/main/routes.py", line 18, in before_request
db.session.commit()
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 157, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 906, in commit
self.transaction.commit()
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 468, in commit
self.session.dispatch.after_commit(self.session)
File "/venv/3.6.4/envs/fmt/lib/python3.6/site-packages/sqlalchemy/event/attr.py", line 218, in __call__
fn(*args, **kw)
File "/projects/flask-mega-tutorial/app/models.py", line 41, in after_commit
for obj in session._changes['add']:
TypeError: 'NoneType' object is not subscriptable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.