Ticket #15621: db-backend-error.diff

File db-backend-error.diff, 1.1 KB (added by Keegan Carruthers-Smith, 14 years ago)
  • django/db/utils.py

     
    4141                        and not f.startswith('.')]
    4242            except EnvironmentError:
    4343                available_backends = []
    44             available_backends.sort()
     44            if backend_name.startswith('django.db.backends.'):
     45                backend_name = backend_name[19:]
    4546            if backend_name not in available_backends:
    4647                error_msg = ("%r isn't an available database backend. \n" +
    4748                    "Try using django.db.backends.XXX, where XXX is one of:\n    %s\n" +
    4849                    "Error was: %s") % \
    49                     (backend_name, ", ".join(map(repr, available_backends)), e_user)
     50                    (backend_name, ", ".join(map(repr, sorted(available_backends))), e_user)
    5051                raise ImproperlyConfigured(error_msg)
    5152            else:
    5253                raise # If there's some other error, this must be an error in Django itself.
Back to Top