attributes_ng/source/django_user: add missing attribute django_user_identifier

This commit is contained in:
Benjamin Dauvergne 2014-06-16 18:05:18 +02:00
parent a4dbd4de7f
commit 0ecad21d62
1 changed files with 2 additions and 1 deletions

View File

@ -42,5 +42,6 @@ def get_attributes(instance, ctx):
ctx['django_user_' + str(av.attribute.name)] = av.to_python()
ctx['django_user_groups'] = [group for group in user.groups.all()]
ctx['django_user_group_names'] = [unicode(group) for group in user.groups.all()]
ctx['django_user_domain'] = user.username.rsplit('@', 1)[-1] if '@' in user.username else ''
ctx['django_user_domain'] = user.username.rsplit('@', 1)[1] if '@' in user.username else ''
ctx['django_user_identifier'] = user.username.rsplit('@', 1)[0] if '@' in user.username else ''
return ctx