summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2021-04-15 13:33:39 +0530
committeradityacp2021-04-15 13:33:39 +0530
commit4756f86290426b5af8878500cf1bfd05e81f528e (patch)
tree874932b77b2ca4ea12916e1b6192050ea2dc0e6c /yaksh/models.py
parentab46880d8608b174de4f8983f2bc2811f0033b60 (diff)
downloadonline_test-4756f86290426b5af8878500cf1bfd05e81f528e.tar.gz
online_test-4756f86290426b5af8878500cf1bfd05e81f528e.tar.bz2
online_test-4756f86290426b5af8878500cf1bfd05e81f528e.zip
Change in views, models, test views
- Remove unnecessary model methods - Fix issue in design question paper for undefined variable error - Fix views test to remove lesson files
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 7686aa0..fd48318 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -391,13 +391,6 @@ class LessonFile(models.Model):
on_delete=models.CASCADE)
file = models.FileField(upload_to=get_file_dir, default=None)
- def remove(self):
- if os.path.exists(self.file.path):
- os.remove(self.file.path)
- if os.listdir(os.path.dirname(self.file.path)) == []:
- os.rmdir(os.path.dirname(self.file.path))
- self.delete()
-
pre_delete.connect(file_cleanup, sender=LessonFile)
###############################################################################
@@ -1695,13 +1688,6 @@ class FileUpload(models.Model):
extract = models.BooleanField(default=False)
hide = models.BooleanField(default=False)
- def remove(self):
- if os.path.exists(self.file.path):
- os.remove(self.file.path)
- if os.listdir(os.path.dirname(self.file.path)) == []:
- os.rmdir(os.path.dirname(self.file.path))
- self.delete()
-
def set_extract_status(self):
if self.extract:
self.extract = False