Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix set_rollback on @transaction.non_atomic_requests.#3016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
xordoquy merged 3 commits intoencode:masterfromhellysmile:non_atomic_requests
Jun 8, 2015

Conversation

@hellysmile
Copy link
Contributor

set_rollback()

checks onlyATOMIC_REQUEST value, but it can be turned off per view by

@transaction.non_atomic_requests

Attempt to rollback without atomic block raises

raiseTransactionManagementError("The rollback flag doesn't work outside of an 'atomic' block.")

https://github.com/django/django/blob/06dc6759d85c6c24b599de07cea47387d3dc2cf9/django/db/backends/base/base.py#L361

Really critical, duehttp404 for every@transaction.non_atomic_requests

Review on Reviewable

@xordoquy
Copy link
Contributor

Thanks for the pull request.
Will try to get it reviewed, merged and released today

@xordoquy
Copy link
Contributor

The provided test is already working against the current master (without your fix being included).
I didn't investigate yet.

@xordoquyxordoquy added the Bug labelJun 8, 2015
@xordoquyxordoquy added this to the3.1.4 Release milestoneJun 8, 2015
@hellysmile
Copy link
ContributorAuthor

@hellysmile
Copy link
ContributorAuthor

Hey,factory.{HTTP_METHOD} do not triggers Django internalBaseHandler.get_response, which wraps views in transitions viaBaseHandler.make_view_atomic.

In addition,django.test.TestCase wraps all database connection in atomic manually,django.test.TransactionTestCase must be used in this case.

@xordoquy can You try now without checkingconnection.in_atomic_block, it will definitely fails.

It was really hard to figure out this Django test internals...

@xordoquy
Copy link
Contributor

@hellysmile ace !

xordoquy added a commit that referenced this pull requestJun 8, 2015
Fix set_rollback on @transaction.non_atomic_requests.
@xordoquyxordoquy merged commitb06f944 intoencode:masterJun 8, 2015
@xordoquy
Copy link
Contributor

Thanks for the PR !

@lovelydinosaurlovelydinosaur modified the milestones:3.1.4 Release,3.2.0 ReleaseJul 30, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.2.0 Release

Development

Successfully merging this pull request may close these issues.

3 participants

@hellysmile@xordoquy@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp