P-259: admin test result
This commit is contained in:
1 parent
7d8c612799
commit
7d60371378
1 file changed
+2
-7
@@ -20,13 +20,8 @@ class TestAttemptAdmin(admin.ModelAdmin):
|
||||
list_display = ('get_user_fio', 'testing_test', 'score', 'completion_date')
|
||||
|
||||
def get_user_fio(self, obj):
|
||||
employee = DictEmployee.objects.filter(user=obj.testing.user).first()
|
||||
return employee.fio if employee else obj.testing.user.username
|
||||
|
||||
# def testing_user(self, obj):
|
||||
# return obj.testing.user.username
|
||||
# testing_user.short_description = 'Пользователь'
|
||||
# testing_user.admin_order_field = 'testing__user'
|
||||
return obj.testing.user.user.fio
|
||||
get_user_fio.admin_order_field = 'testing__user__user__fio'
|
||||
|
||||
def testing_test(self, obj):
|
||||
return obj.testing.test
|
||||
|
||||
Reference in new issue
Block a user