Skip to content

Commit

Permalink
Added the durable parameter in Atomic decorator and context-manager (#…
Browse files Browse the repository at this point in the history
…172)

Hello,

Just stumbled across a missing parameter inside the `Atomic` context-manager which was added in `Django 3.2`.

Hope this helps...
  • Loading branch information
sronveaux committed Jul 4, 2023
1 parent d97beb9 commit d5db624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django-stubs/db/transaction.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ _C = TypeVar("_C", bound=Callable[..., Any])
class Atomic:
using: Optional[str] = ...
savepoint: bool = ...
def __init__(self, using: Optional[str], savepoint: bool) -> None: ...
def __init__(self, using: Optional[str], savepoint: bool, durable: bool = ...) -> None: ...
# When decorating, return the decorated function as-is, rather than clobbering it as ContextDecorator does.
def __call__(self, func: _C) -> _C: ...
def __enter__(self) -> None: ...
Expand All @@ -40,7 +40,7 @@ def atomic(using: _C) -> _C: ...

# Decorator or context-manager with parameters
@overload
def atomic(using: Optional[str] = ..., savepoint: bool = ...) -> Atomic: ...
def atomic(using: Optional[str] = ..., savepoint: bool = ..., durable: bool = ...) -> Atomic: ...

# Bare decorator
@overload
Expand Down

0 comments on commit d5db624

Please sign in to comment.