Don't return filename from upload
The uploader only needs to return the object_name of the uploaded object. The filename is read directly from the input, so there's no need to return it as well.
This commit is contained in:
@@ -25,12 +25,12 @@ class Attachment(Base, mixins.TimestampsMixin):
|
||||
@classmethod
|
||||
def attach(cls, fyle, resource=None, resource_id=None):
|
||||
try:
|
||||
filename, object_name = app.uploader.upload(fyle)
|
||||
object_name = app.uploader.upload(fyle)
|
||||
except UploadError as e:
|
||||
raise AttachmentError("Could not add attachment. " + str(e))
|
||||
|
||||
attachment = Attachment(
|
||||
filename=filename,
|
||||
filename=fyle.filename,
|
||||
object_name=object_name,
|
||||
resource=resource,
|
||||
resource_id=resource_id,
|
||||
|
||||
Reference in New Issue
Block a user