Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
87b63041
Commit
87b63041
authored
3 months ago
by
Anton Sattarov
Committed by
Pavel Antonov
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(files): Исправлена ошибка при которой временные файлы не перемещались в постоянное хранилище
parent
957a224e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
perxis-proto
+1
-1
1 addition, 1 deletion
perxis-proto
pkg/files/field.go
+5
-7
5 additions, 7 deletions
pkg/files/field.go
with
6 additions
and
8 deletions
perxis-proto
@
0627c9f8
Compare
278f919c
...
0627c9f8
Subproject commit
278f919cda5b9d9aac548f1714213eaf52c28d7f
Subproject commit
0627c9f829178bc6de2623a0b6d42964c44de496
This diff is collapsed.
Click to expand it.
pkg/files/field.go
+
5
−
7
View file @
87b63041
...
...
@@ -2,7 +2,6 @@ package files
import
(
"context"
"errors"
"fmt"
"io"
"net/url"
...
...
@@ -132,17 +131,16 @@ func (t FileType) PreSave(ctx context.Context, fld *field.Field, v interface{},
return
nil
,
false
,
nil
}
f
:=
v
.
(
*
File
)
if
f
.
ID
==
""
{
return
nil
,
false
,
errors
.
New
(
"FileType: file id required"
)
}
if
!
f
.
Temporary
{
return
f
,
false
,
nil
}
// Выполняет проверка и сохранение файла в постоянное хранилище
// Если файл уже находится в постоянном хранилище, то ничего не делаем
// TODO при реализации SaveFile нужно передавать флаг или ошибку
// - чтобы корректно отдавать флаr changed если файл не перемещался
f
,
err
:=
t
.
fs
.
MoveUpload
(
ctx
,
&
MultipartUpload
{
File
:
*
f
})
if
err
!=
nil
{
return
nil
,
false
,
err
}
return
f
,
true
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment