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
d3dff802
Commit
d3dff802
authored
2 years ago
by
Thorge Petersen
Browse files
Options
Downloads
Patches
Plain Diff
Harvest blueprint
parent
8955cd77
No related branches found
No related tags found
2 merge requests
!41
Version 2.0.0
,
!38
Merge py3 into dev
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/plugin.py
+5
-3
5 additions, 3 deletions
ckanext/odsh/plugin.py
ckanext/odsh/views/harvest.py
+18
-5
18 additions, 5 deletions
ckanext/odsh/views/harvest.py
with
23 additions
and
8 deletions
ckanext/odsh/plugin.py
+
5
−
3
View file @
d3dff802
...
@@ -96,9 +96,11 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
...
@@ -96,9 +96,11 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
bp_dashboard
.
add_url_rule
(
bp_dashboard
.
add_url_rule
(
u
'
/dashboard/datasets
'
,
view_func
=
dashboard
.
dashboard_datasets
)
u
'
/dashboard/datasets
'
,
view_func
=
dashboard
.
dashboard_datasets
)
#
#
Harvest
bp_harvest
=
harvest
.
blueprint
bp_harvest
=
harvest
.
blueprint
bp_harvest
.
add_url_rule
(
u
'
/harvest/new
'
,
view_func
=
dashboard
.
new
)
bp_harvest
.
add_url_rule
(
u
'
/harvest/new
'
,
view_func
=
harvest
.
new
)
bp_harvest
.
add_url_rule
(
u
'
/harvest
'
,
view_func
=
harvest
.
search
)
return
[
bp_default
,
bp_package
,
bp_user
,
bp_dashboard
,
bp_harvest
]
return
[
bp_default
,
bp_package
,
bp_user
,
bp_dashboard
,
bp_harvest
]
# IActions
# IActions
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/views/harvest.py
+
18
−
5
View file @
d3dff802
import
ckan.plugins.toolkit
as
toolkit
import
ckan.plugins.toolkit
as
toolkit
import
ckan.authz
as
authz
from
flask
import
Blueprint
from
flask
import
Blueprint
from
ckan.views.dataset
import
CreateView
import
ckan.views.dataset
as
dataset
from
ckan.common
import
g
import
logging
import
logging
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
blueprint
=
Blueprint
(
'
odsh_
defaul
t
'
,
__name__
)
blueprint
=
Blueprint
(
'
odsh_
harves
t
'
,
__name__
)
def
new
():
def
new
():
log
.
info
(
"
views.harvest::new
"
)
log
.
debug
(
"
views.harvest::new
"
)
return
CreateView
.
as_view
(
str
(
u
'
new
'
))
is_sysadmin
=
authz
.
is_sysadmin
(
g
.
user
)
#toolkit.abort(404)
\ No newline at end of file
if
not
is_sysadmin
:
toolkit
.
abort
(
403
)
return
dataset
.
CreateView
.
as_view
(
str
(
u
'
new
'
))(
'
harvest
'
)
def
search
():
log
.
debug
(
"
views.harvest::search
"
)
is_sysadmin
=
authz
.
is_sysadmin
(
g
.
user
)
if
not
is_sysadmin
:
toolkit
.
abort
(
403
)
return
dataset
.
search
(
'
harvest
'
)
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