Skip to content

Commit

Permalink
Avoid crash during initial migration
Browse files Browse the repository at this point in the history
As suggested by @elelay on
gpodder#32 (comment)
  • Loading branch information
JeanFred committed Jul 1, 2017
1 parent 5da5260 commit d8d89a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mygpo/users/checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.checks import register, Warning
from django.db import connection
from django.db.utils import OperationalError
from django.db.utils import OperationalError, ProgrammingError


SQL = """
Expand Down Expand Up @@ -29,8 +29,8 @@ def check_case_insensitive_users(app_configs=None, **kwargs):
wid = 'users.W001'
errors.append(Warning(txt, id=wid))

except OperationalError as oe:
if 'no such table: auth_user' in str(oe):
except (OperationalError, ProgrammingError) as oe:
if 'no such table: auth_user' in str(oe) or 'relation "auth_user" does not exist' in str(oe):
# Ignore if the table does not yet exist, eg when initally
# running ``manage.py migrate``
pass
Expand Down

0 comments on commit d8d89a2

Please sign in to comment.