From 56307710adf14286fcfcb38c7a80134db1c1435f Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 8 Mar 2021 11:46:26 +0000 Subject: [PATCH] . --- longs/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/longs/models.py b/longs/models.py index 23a45b81..8755631c 100644 --- a/longs/models.py +++ b/longs/models.py @@ -49,9 +49,6 @@ image_storage = FileSystemStorage( def image_directory_path(instance, filename): return u"longs/picture/{0}".format(filename) -def question_file_directory_path(instance, filename): - return u"longs/question/{0}".format(filename) - def findMiddle(input_list): middle = float(len(input_list)) / 2 @@ -173,7 +170,8 @@ class Long(models.Model): q = get_object_or_404(Long, pk=question_id) #exam_order.append(q.id) - with open(question_file_directory_path(question_id), "w") as f: + path=u"{0}longs/questions/{1}".format(settings.MEDIA_ROOT, question_id), + with open(path, "w") as f: # Loop through longimage associations f.write("[") images = []