diff options
author | adityacp | 2021-04-15 13:33:39 +0530 |
---|---|---|
committer | adityacp | 2021-04-15 13:33:39 +0530 |
commit | 4756f86290426b5af8878500cf1bfd05e81f528e (patch) | |
tree | 874932b77b2ca4ea12916e1b6192050ea2dc0e6c /yaksh/models.py | |
parent | ab46880d8608b174de4f8983f2bc2811f0033b60 (diff) | |
download | online_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.py | 14 |
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 |