Commit 8b14a3f3 by Bach Dániel

one: fixed warning in instance_count()

parent d02be623
...@@ -32,8 +32,8 @@ class MyUserAdmin(contrib.auth.admin.UserAdmin): ...@@ -32,8 +32,8 @@ class MyUserAdmin(contrib.auth.admin.UserAdmin):
inlines = (PersonInline, SshKeyInline, DetailsInline) inlines = (PersonInline, SshKeyInline, DetailsInline)
def instance_count(self, obj): def instance_count(self, obj):
return _("%d (%d active)") % (obj.instance_set.count(), return _("%(sum)d (%(active)d active)") % { 'sum': obj.instance_set.count(),
obj.instance_set.filter(state='ACTIVE').count(), ) 'active' :obj.instance_set.filter(state='ACTIVE').count(), }
def course_groups(self, obj): def course_groups(self, obj):
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment