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

Already on GitHub? Sign in to your account

Avoid missing table errors on initial syncdb or migrate. see : https://g... #2

Merged
merged 1 commit into from Dec 29, 2011

Conversation

Projects
None yet
3 participants
Contributor

airtonix commented Dec 18, 2011

#1

MegaMark16 added a commit that referenced this pull request Dec 29, 2011

Merge pull request #2 from airtonix/patch-1
Avoid missing table errors on initial syncdb or migrate. see : https://g...

@MegaMark16 MegaMark16 merged commit b8ea502 into MegaMark16:master Dec 29, 2011

This error still occurs if using psycopg2, because the transaction is never rolled back, and any subsequent attempt to use the database fails. It appears to be possible to work around this by catching the DatabaseError and rolling back the transaction as necessary. E.g.:

def set_themes():
try:
if not Site.objects.filter(id=settings.SITE_ID):
return
except DatabaseError:
connection.rollback();
return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment