Ticket #1413: model-import-error.diff

File model-import-error.diff, 735 bytes (added by Antti Kaihola, 18 years ago)

strip '.models' from module path in the error message

  • magic-removal/django/db/models/base.py

     
    2828
    2929        # Raise ImportError if this model isn't in INSTALLED_APPS.
    3030        if re.sub('\.models$', '', mod) not in settings.INSTALLED_APPS:
    31             raise ImportError, "INSTALLED_APPS must contain %r in order for you to use this model." % mod
     31            raise ImportError, "INSTALLED_APPS must contain %r in order for you to use this model." % re.sub('\.models$', '', mod)
    3232
    3333        # Create the class.
    3434        new_class = type.__new__(cls, name, bases, {'__module__': mod})
Back to Top