[WEB-1312] fix: trim file name before uploading (#4661)
* fix: trim file name before uploading * fix: check the cursor position before inserting image * dev: add trimming for file assets * dev: add filename validation above if * dev: make the validation to 50 to support user uploads --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
This commit is contained in:
parent
7e66e2736b
commit
20acb0dd17
2 changed files with 29 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ from .base import BaseModel
|
|||
|
||||
|
||||
def get_upload_path(instance, filename):
|
||||
filename = filename[:50]
|
||||
if instance.workspace_id is not None:
|
||||
return f"{instance.workspace.id}/{uuid4().hex}-{filename}"
|
||||
return f"user-{uuid4().hex}-{filename}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue