Skip to content

Commit 346fc97

Browse files
Raise DatabaseConfigurationError when backward relation name equals table name (#462)
1 parent 70efe6a commit 346fc97

File tree

7 files changed

+75
-58
lines changed

7 files changed

+75
-58
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning].
1010
### Fixed
1111

1212
- codegen: Fixed invalid `models.py` template.
13-
- context: Do not wrap known exceptions with `CallbackError`
13+
- context: Do not wrap known exceptions with `CallbackError`.
14+
- database: Raise `DatabaseConfigurationError` when backward relation name equals table name.
1415
- database: Wrap schema wiping in a transaction to avoid orphaned tables in the immune schema.
1516
- hasura: Fixed processing M2M relations.
1617
- sentry: Fixed "invalid value `environment`" error.

poetry.lock

Lines changed: 58 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/demo_tzcolors/handlers/on_bid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async def on_bid(
1515
id=bid.parameter.__root__,
1616
).get()
1717

18-
bidder, _ = await models.Address.get_or_create(address=bid.data.sender_address)
18+
bidder, _ = await models.User.get_or_create(address=bid.data.sender_address)
1919
await models.Bid(
2020
auction=auction,
2121
bidder=bidder,

src/demo_tzcolors/handlers/on_create_auction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async def on_create_auction(
1010
create_auction: Transaction[CreateAuctionParameter, TzcolorsAuctionStorage],
1111
) -> None:
1212

13-
holder, _ = await models.Address.get_or_create(address=create_auction.data.sender_address)
13+
holder, _ = await models.User.get_or_create(address=create_auction.data.sender_address)
1414

1515
token, _ = await models.Token.get_or_create(
1616
id=create_auction.parameter.token_id,

0 commit comments

Comments
 (0)