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 e47673c commit 10669b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changelog

0.16
====
0.16.5
------
* Moved ``Tortoise.describe_model(<MODEL>, ...)`` to ``<MODEL>.describe(...)``
* Deprecated ``Tortoise.describe_model()``
* Fix for ``generate_schemas`` param being ignored in ``tortoise.contrib.quart.register_tortoise``

0.16.4
------
* More consistent escaping of db columns, fixes using SQL reserved keywords as field names with a function.
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 @@ -77,12 +77,13 @@ def register_tortoise(
ConfigurationError
For any configuration error
"""
_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 10669b5

Please sign in to comment.