Skip to content

Instantly share code, notes, and snippets.

@shabda
Created June 8, 2015 12:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shabda/e69bc239cac805a970cd to your computer and use it in GitHub Desktop.
In [1]: import django; django.get_version()
Out[1]: '1.8'
In [2]: from django.db import transaction
In [3]: transaction.set_autocommit(False)
In [4]: from django.contrib.auth import get_user_model
In [5]: get_user_model().objects.create(username="test_24921")
---------------------------------------------------------------------------
TransactionManagementError Traceback (most recent call last)
<ipython-input-5-364c4b9477ca> in <module>()
----> 1 get_user_model().objects.create(username="test_24921")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment