summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorCruiseDevice2021-03-03 23:55:24 +0530
committerCruiseDevice2021-03-03 23:55:24 +0530
commit085b1fae43a16cff87e1ab0cf3730e84d4943442 (patch)
treec0db8f266b6a008d6d3544a00c63849fa88908f1 /yaksh/models.py
parent3523fea7d001d3e9ecdd9d87b94121b8c8e75ef0 (diff)
downloadonline_test-085b1fae43a16cff87e1ab0cf3730e84d4943442.tar.gz
online_test-085b1fae43a16cff87e1ab0cf3730e84d4943442.tar.bz2
online_test-085b1fae43a16cff87e1ab0cf3730e84d4943442.zip
Fix failing test
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index ca0f2d8..30c69c3 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -121,15 +121,16 @@ MOD_GROUP_NAME = 'moderator'
def get_assignment_dir(instance, filename):
- folder = str(instance.answer_paper.course_id)
- sub_folder = str(instance.answer_paper.question_paper.quiz_id)
+ course = instance.answer_paper.course
+ quiz = instance.answer_paper.question_paper.quiz
+ folder = f'{course.name.replace(" ", "_")}_{course.id}'
+ sub_folder = f'{quiz.description.replace(" ","_")}_{quiz.id}'
user = instance.answer_paper.user.username
return os.sep.join((folder, sub_folder, user,
str(instance.assignmentQuestion.id),
filename
))
-
def get_model_class(model):
ctype = ContentType.objects.get(app_label="yaksh", model=model)
model_class = ctype.model_class()