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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed legacy code from old transaction system #3489

Merged
merged 1 commit into from Nov 10, 2014

Conversation

Projects
None yet
2 participants
@tchaumeny
Contributor

tchaumeny commented Nov 9, 2014

No description provided.

@aaugustin

This comment has been minimized.

Show comment
Hide comment
@aaugustin

aaugustin Nov 10, 2014

Member

You should also remove this piece of code:

real_commit = transaction.commit
real_rollback = transaction.rollback


def nop(*args, **kwargs):
    return


def disable_transaction_methods():
    transaction.commit = nop
    transaction.rollback = nop


def restore_transaction_methods():
    transaction.commit = real_commit
    transaction.rollback = real_rollback
Member

aaugustin commented Nov 10, 2014

You should also remove this piece of code:

real_commit = transaction.commit
real_rollback = transaction.rollback


def nop(*args, **kwargs):
    return


def disable_transaction_methods():
    transaction.commit = nop
    transaction.rollback = nop


def restore_transaction_methods():
    transaction.commit = real_commit
    transaction.rollback = real_rollback
for db_name in reversed(self._databases_names()):
# Hack to force a rollback

This comment has been minimized.

@aaugustin

aaugustin Nov 10, 2014

Member

It's a good idea to remove that comment, however, you should also remove the hack while you're there :-)

I added a public API for forcing a rollback since I wrote that code:

transaction.set_rollback(True, using=db_name)
@aaugustin

aaugustin Nov 10, 2014

Member

It's a good idea to remove that comment, however, you should also remove the hack while you're there :-)

I added a public API for forcing a rollback since I wrote that code:

transaction.set_rollback(True, using=db_name)
@tchaumeny

This comment has been minimized.

Show comment
Hide comment
@tchaumeny

tchaumeny Nov 10, 2014

Contributor

Thanks aaugustin for review!

Contributor

tchaumeny commented Nov 10, 2014

Thanks aaugustin for review!

aaugustin added a commit that referenced this pull request Nov 10, 2014

Merge pull request #3489 from tchaumeny/testcases_cleanup
Removed legacy code from old transaction system

@aaugustin aaugustin merged commit 542fd80 into django:master Nov 10, 2014

1 check passed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment