Ticket #12224: ticket#1224.diff
File ticket#1224.diff, 1008 bytes (added by , 15 years ago) |
---|
-
django/contrib/auth/management/__init__.py
4 4 5 5 from django.db.models import get_models, signals 6 6 from django.contrib.auth import models as auth_app 7 from django.utils.encoding import force_unicode 7 8 8 9 def _get_permission_codename(action, opts): 9 10 return u'%s_%s' % (action, opts.object_name.lower()) … … 25 26 ctype = ContentType.objects.get_for_model(klass) 26 27 for codename, name in _get_all_permissions(klass._meta): 27 28 p, created = Permission.objects.get_or_create(codename=codename, content_type__pk=ctype.id, 28 defaults={'name': name, 'content_type': ctype})29 defaults={'name': force_unicode(name), 'content_type': ctype}) 29 30 if created and verbosity >= 2: 30 31 print "Adding permission '%s'" % p 31 32