mirror of
https://github.com/wekan/wekan.git
synced 2026-02-23 08:24:07 +01:00
WRITABLE_PATH is mandatory, so simplify the code logic
This commit is contained in:
parent
d63f1b740c
commit
927f155078
3 changed files with 6 additions and 12 deletions
|
|
@ -17,10 +17,8 @@ Avatars = new FilesCollection({
|
|||
collectionName: 'avatars',
|
||||
allowClientCode: true,
|
||||
storagePath() {
|
||||
if (process.env.WRITABLE_PATH) {
|
||||
return path.join(process.env.WRITABLE_PATH, 'uploads', 'avatars');
|
||||
}
|
||||
return path.normalize(`assets/app/uploads/${this.collectionName}`);;
|
||||
const ret = path.join(process.env.WRITABLE_PATH, 'avatars');
|
||||
return ret;
|
||||
},
|
||||
onBeforeUpload(file) {
|
||||
if (file.size <= 72000 && file.type.startsWith('image/')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue