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 os
|
||||||
|
|
||||||
import Ernestophone.settings
|
from django.conf import settings
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
PARTITION_TYPES = (
|
PARTITION_TYPES = (
|
||||||
("active", "Actif"),
|
("active", "Actif"),
|
||||||
|
@ -20,8 +21,7 @@ class Partition(models.Model):
|
||||||
return self.nom
|
return self.nom
|
||||||
|
|
||||||
def delete(self, *args, **kwargs):
|
def delete(self, *args, **kwargs):
|
||||||
os.remove(os.path.join(Ernestophone.settings.MEDIA_ROOT,
|
os.remove(os.path.join(settings.MEDIA_ROOT, self.part.name))
|
||||||
self.part.name))
|
|
||||||
super(Partition, self).delete(*args, **kwargs)
|
super(Partition, self).delete(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue