Skip to content

Commit

Permalink
Fix for generate_schemas param being ignored in tortoise.contrib.quar…
Browse files Browse the repository at this point in the history
…t.register_tortoise (#344)
  • Loading branch information
grigi committed Apr 9, 2020
1 parent 4963753 commit 1821abb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
0.15.22
-------
* Fix the aggregates using the wrong side of the join when doing a self-referential aggregation.
* Fix for ``generate_schemas`` param being ignored in ``tortoise.contrib.quart.register_tortoise``

0.15.21
-------
Expand Down
3 changes: 2 additions & 1 deletion tortoise/contrib/quart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ def register_tortoise(
True to generate schema immediately. Only useful for dev environments
or SQLite ``:memory:`` databases
"""
_generate_schemas = generate_schemas

@app.before_serving
async def init_orm() -> None: # pylint: disable=W0612
await Tortoise.init(config=config, config_file=config_file, db_url=db_url, modules=modules)
logging.info("Tortoise-ORM started, %s, %s", Tortoise._connections, Tortoise.apps)
if generate_schemas:
if _generate_schemas:
logging.info("Tortoise-ORM generating schema")
await Tortoise.generate_schemas()

Expand Down

0 comments on commit 1821abb

Please sign in to comment.