Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
d567b490
Commit
d567b490
authored
4 years ago
by
Jesper Zedlitz
Browse files
Options
Downloads
Patches
Plain Diff
Kopieren von Dateien während des Harvest-Prozesses konfigurierbar
parent
b02664af
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!17
Stage System soll in Zukunft Master Branch erhalten
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ckanext/odsh/logic/action.py
+10
-5
10 additions, 5 deletions
ckanext/odsh/logic/action.py
with
10 additions
and
5 deletions
ckanext/odsh/logic/action.py
+
10
−
5
View file @
d567b490
...
...
@@ -5,6 +5,7 @@ import ckan.model as model
import
ckan.lib.dictization.model_dictize
as
model_dictize
from
ckan.lib.munge
import
munge_title_to_name
import
ckan.plugins.toolkit
as
toolkit
from
pylons
import
config
from
ckan.lib.search.common
import
make_connection
,
SearchError
import
pysolr
import
datetime
...
...
@@ -147,10 +148,14 @@ def autocomplete(context, data_dict):
def
odsh_resource_create
(
context
,
data_dict
):
is_linked_resource
=
not
isinstance
(
data_dict
[
'
upload
'
],
cgi
.
FieldStorage
)
if
is_linked_resource
:
_download_linked_resource_to_tmp
(
data_dict
[
'
url
'
])
_emulate_file_upload
(
data_dict
)
copy_remote_resources
=
toolkit
.
asbool
(
config
.
get
(
'
ckanext.odsh.copy_remote_resources
'
,
'
False
'
)
)
if
copy_remote_resources
:
is_linked_resource
=
(
not
'
upload
'
in
data_dict
)
or
(
not
isinstance
(
data_dict
[
'
upload
'
],
cgi
.
FieldStorage
))
if
is_linked_resource
:
_download_linked_resource_to_tmp
(
data_dict
[
'
url
'
])
_emulate_file_upload
(
data_dict
)
return
resource_create
(
context
,
data_dict
)
TMP_FILE_PATH
=
'
/tmp/temp_file_upload
'
...
...
@@ -181,4 +186,4 @@ def _emulate_file_upload(data_dict):
upload
.
headers
[
'
content-type
'
]
=
upload
.
type
upload
.
name
=
'
upload
'
upload
.
filename
=
filename
data_dict
[
'
upload
'
]
=
upload
\ No newline at end of file
data_dict
[
'
upload
'
]
=
upload
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