|
@@ -20,8 +20,8 @@ class UploadManager(models.Manager):
|
|
|
width = None
|
|
|
height = None
|
|
|
|
|
|
- path = UploadManager.calculatePath(type, tenant.id, user.id)
|
|
|
- filename = UploadFile(file, path)
|
|
|
+ path = UploadManager.calculatePath(type, tenant.id)
|
|
|
+ filename = UploadFile(file, path, user.id)
|
|
|
fullname = "%s%s" % (settings.MEDIA_ROOT, filename)
|
|
|
|
|
|
try:
|
|
@@ -49,8 +49,8 @@ class UploadManager(models.Manager):
|
|
|
|
|
|
def _addnew_voice(self, tenant, user, type, file):
|
|
|
|
|
|
- path = UploadManager.calculatePath(type, tenant.id, user.id)
|
|
|
- filename = UploadFile(file, path)
|
|
|
+ path = UploadManager.calculatePath(type, tenant.id)
|
|
|
+ filename = UploadFile(file, path, user.id)
|
|
|
# fullname = "%s%s" % (settings.MEDIA_ROOT, filename)
|
|
|
|
|
|
instance = self.model(
|
|
@@ -66,7 +66,7 @@ class UploadManager(models.Manager):
|
|
|
return instance
|
|
|
|
|
|
@staticmethod
|
|
|
- def calculatePath(type, tenant_id, user_id):
|
|
|
+ def calculatePath(type, tenant_id):
|
|
|
path_map = {
|
|
|
Upload.REPAIR_IMAGE: repair_image,
|
|
|
Upload.INSPECTION_IMAGE: inspection_image,
|
|
@@ -74,7 +74,7 @@ class UploadManager(models.Manager):
|
|
|
Upload.REPAIR_VOICE:repair_image,
|
|
|
}
|
|
|
|
|
|
- return path_map[type] + str(tenant_id) + str(user_id) + '/'
|
|
|
+ return path_map[type] + str(tenant_id) + '/'
|
|
|
|
|
|
|
|
|
repair_image = "repair/"
|