Ticket #1471: django_1471.diff

File django_1471.diff, 1.6 KB (added by Christopher Lenz <cmlenz@…>, 9 years ago)

Patch that fixes the problem

  • django/core/management.py

     
    427427            except Exception, e:
    428428                # stop trying to install permissions
    429429                install_permissions = False
    430                 sys.stderr.write("Permissions will not be installed because it "\
    431                                  "appears that you are not using Django's auth framework. "\
    432                                  "If you want to install them in the future, re-run syncdb."\
    433                                  "\n(The full error was: %s)" % e)
     430                sys.stderr.write("Permissions will not be installed because it "
     431                                 "appears that you are not using Django's auth framework. "
     432                                 "If you want to install them in the future, re-run syncdb."
     433                                 "\n(The full error was: %s)\n" % e)
    434434                transaction.rollback_unless_managed()
    435435            else:
    436436                transaction.commit_unless_managed()
     
    563563    from django.contrib.contenttypes.models import ContentType
    564564    from django.contrib.auth.models import Permission
    565565    from django.db.models import get_models
    566     num_added = 0
    567566    app_models = get_models(app)
     567    if not app_models:
     568        return
    568569    app_label = app_models[0]._meta.app_label
     570    num_added = 0
    569571    for klass in app_models:
    570572        opts = klass._meta
    571573        ctype = ContentType.objects.get_for_model(klass)
Back to Top