diff --git a/tortoise/models.py b/tortoise/models.py index 8436a46ee..83de86890 100644 --- a/tortoise/models.py +++ b/tortoise/models.py @@ -1062,7 +1062,11 @@ async def get_or_create( ) except DoesNotExist: try: - return await cls.create(using_db=connection, **defaults, **kwargs), True + merged_defaults = {**defaults, **kwargs} + return ( + await cls.create(using_db=connection, **merged_defaults), + True, + ) except (IntegrityError, TransactionManagementError): return await cls.filter(**kwargs).using_db(connection).get(), False