summaryrefslogtreecommitdiff
path: root/yaksh/admin.py
diff options
context:
space:
mode:
authorPalaparthy Adityachandra2020-03-09 11:53:37 +0530
committerGitHub2020-03-09 11:53:37 +0530
commitb3362b8a5d09184407ae988699b22b46485a916e (patch)
tree4142a2b7548de8708bd2c3a7872bbdc53339b823 /yaksh/admin.py
parent2bf66a0cdf07764d91e0274a1effb050075a1206 (diff)
parent51f6231706bb81ef24a3934f3d20f34f8b133ec4 (diff)
downloadonline_test-b3362b8a5d09184407ae988699b22b46485a916e.tar.gz
online_test-b3362b8a5d09184407ae988699b22b46485a916e.tar.bz2
online_test-b3362b8a5d09184407ae988699b22b46485a916e.zip
Merge pull request #659 from ankitjavalkar/bug_fixes_26_feb_2020
Multiple Changes
Diffstat (limited to 'yaksh/admin.py')
-rw-r--r--yaksh/admin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/yaksh/admin.py b/yaksh/admin.py
index 495b48d..9c36a98 100644
--- a/yaksh/admin.py
+++ b/yaksh/admin.py
@@ -9,6 +9,14 @@ from django.contrib import admin
class AnswerPaperAdmin(admin.ModelAdmin):
search_fields = ['user__first_name', 'user__last_name', 'user__username',
"question_paper__quiz__description", "user_ip"]
+ list_filter = ['course__is_trial']
+ readonly_fields = ["course", "question_paper"]
+
+ def get_form(self, request, obj=None, **kwargs):
+ self.exclude = ("answers", "questions_unanswered",
+ "questions_answered", "questions")
+ form = super(AnswerPaperAdmin, self).get_form(request, obj, **kwargs)
+ return form
class ProfileAdmin(admin.ModelAdmin):