id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux
6040 post_syncdb signal and contrib.auth permissions Dan nobody "This is a feature request for contrib.auth's management.py
In an app's management.py, doing:
{{{
from myapp import models
from django.contrib.auth.models import Permission
def init_data():
perm = Permission.objects.get(codename=)
dispatcher.connect(init_data, sender=models, signal=signals.post_syncdb)
}}}
where is something like ""change_mymodel"", will trigger a DoesNotExist exception on first run of syncdb.
The problem is that contrib.auth is receiving the post_syncdb signal before ""myapp"", and there doesn't appear to be a way to force myapp to be the last receiver of the signal. Changing the order of the apps in settings.py has no effect.
A suggested solution would be to add a new signal fired by contrib.auth after creation of permissions. Or am I missing an obvious way to handle after contrib.auth?
" closed Contrib apps master invalid auth contrib.auth post_syncdb management.py Unreviewed 0 0 0 0