Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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