Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
26ab7cc2
Commit
26ab7cc2
authored
8 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Fix file origin for packfile upload
parent
8894ec72
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/placer.py
+11
-2
11 additions, 2 deletions
api/placer.py
with
11 additions
and
2 deletions
api/placer.py
+
11
−
2
View file @
26ab7cc2
...
...
@@ -10,11 +10,12 @@ import zipfile
from
.
import
config
from
.
import
encoder
from
.
import
files
from
.jobs
import
rules
from
.
import
tempdir
as
tempfile
from
.
import
util
from
.
import
validators
from
.dao
import
containerutil
,
hierarchy
from
.jobs
import
rules
from
.types
import
Origin
log
=
config
.
log
...
...
@@ -401,6 +402,15 @@ class PackfilePlacer(Placer):
# Remove the folder created by TokenPlacer
shutil
.
rmtree
(
self
.
folder
)
# Lookup uid on token
token
=
self
.
context
[
'
token
'
]
uid
=
config
.
db
[
'
tokens
'
].
find_one
({
'
_id
'
:
token
}).
get
(
'
user
'
)
self
.
origin
=
{
'
type
'
:
str
(
Origin
.
user
),
'
id
'
:
uid
}
# Create an anyonmous object in the style of our augmented file fields.
# Not a great practice. See process_upload() for details.
cgi_field
=
util
.
obj_from_map
({
...
...
@@ -496,7 +506,6 @@ class PackfilePlacer(Placer):
self
.
save_file
(
cgi_field
,
cgi_info
)
# Delete token
token
=
self
.
context
[
'
token
'
]
config
.
db
[
'
tokens
'
].
delete_one
({
'
_id
'
:
token
})
result
=
{
...
...
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