0001-compat-ignore-error-on-checking-db-vendor-fixes-2992.patch
src/authentic2/compat.py | ||
---|---|---|
4 | 4 |
import django |
5 | 5 |
from django.conf import settings |
6 | 6 |
from django.db import connection |
7 |
from django.db.utils import OperationalError |
|
8 |
from django.core.exceptions import ImproperlyConfigured |
|
7 | 9 | |
8 | 10 |
from django.contrib.auth.tokens import PasswordResetTokenGenerator |
9 | 11 | |
... | ... | |
25 | 27 | |
26 | 28 | |
27 | 29 |
def has_postgresql_support(): |
28 |
if not settings.DATABASES['default'].get('NAME'): |
|
30 |
try: |
|
31 |
return connection.vendor == 'postgresql' and connection.pg_version > 90400 |
|
32 |
except (ImproperlyConfigured, OperationalError): |
|
33 |
# database is not initialized, be conservative |
|
29 | 34 |
return False |
30 |
return connection.vendor == 'postgresql' and connection.pg_version > 90400 |
|
31 | 35 | |
32 | 36 | |
33 | 37 |
def use_django_native_field(): |
34 |
- |