Valid usage of settings.MEDIA_ROOT
This commit is contained in:
parent
d7c388362c
commit
b39de0d6e1
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,8 @@
|
|||
from django.db import models
|
||||
import os
|
||||
|
||||
import Ernestophone.settings
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
|
||||
PARTITION_TYPES = (
|
||||
("active", "Actif"),
|
||||
|
@ -20,8 +21,7 @@ class Partition(models.Model):
|
|||
return self.nom
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
os.remove(os.path.join(Ernestophone.settings.MEDIA_ROOT,
|
||||
self.part.name))
|
||||
os.remove(os.path.join(settings.MEDIA_ROOT, self.part.name))
|
||||
super(Partition, self).delete(*args, **kwargs)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue