-
Notifications
You must be signed in to change notification settings - Fork 4
Upgrade to python3 ckan2 11 #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kovalch
wants to merge
206
commits into
master
Choose a base branch
from
upgrade_to_python3_ckan2_11
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 169 commits
Commits
Show all changes
206 commits
Select commit
Hold shift + click to select a range
346afe3
feat: Update solr schema and solrconfig
kovalch 76d6647
feat: Modify setup file
kovalch 115c039
feat: Update requirements for the python3
kovalch d542528
fix: Use Python’s built-in collections
kovalch 2bfdb36
fix: Update tests settings
kovalch a5d6f0f
fix: Remove double deffinition of collections
kovalch 66a436b
fix: Update render
kovalch c3a6a82
fix: Revrite get_activities
kovalch 60e1aa5
fix: In Python 3 the quote function lives in urllib.parse
kovalch 82f8005
fix: Update the import for urlparse
kovalch 9ddd2fc
feat: Make imports python3 compartible
kovalch a1d5d45
feat: Require black and isort
bellisk db4f7e6
style: Run black on codebase
bellisk 6947daf
style: Run isort
bellisk 54645a1
feat: Run 2to3 to convert to Python 3 code
bellisk 2abd245
style: Run black again
bellisk c06037e
style: Remove 'noqa' markers and run black again
bellisk 312653e
style: Mark overly-complex code as noqa: C901 for now
bellisk 1b84acc
style: Check for and fix a couple more types of errors
bellisk c1db86c
style: Convert string formatting to use f-strings
bellisk a20d3ec
style: Convert string concatenation to use f-strings
bellisk 4d3516a
style: Convert static list joins to use f-strings
bellisk 235ff77
style: Convert string formatting to use f-strings
bellisk 878cef3
style: Run black
bellisk 6659e53
style: Fix overly long lines created by flynt
bellisk 676befe
Merge pull request #350 from opendata-swiss/feat/update-to-python-3-c…
kovalch 0652380
style: Fix some typos
bellisk 9ee6eb3
tests: Fix ckan version and solr tag
bellisk 61de2e1
tests: Fix ckan container tag
bellisk 139b0db
tests: Install test requirements as root
bellisk 8d08612
tests: Fix syntax
bellisk d73ee89
tests: Create ckan container with user=root
bellisk 827b57d
tests: Use most recent versions of all ckanexts
bellisk 82ad1e3
tests: Update db init and migration commands
bellisk 9a9903f
tests: Add debug statement
bellisk d8808ed
feat: Update team's email address
bellisk d0a89a8
tests: Add debug statement
bellisk 6dae045
tests: Update ckan commands to put config in the right place
bellisk 83a5832
tests: Escape % in test.ini
bellisk 3c034fe
fix: Remove IRouter, The IRoutes interface has been removed since it …
kovalch 31aa0f8
fix: Remove perma route from update_config, we have perma_redirect
kovalch f16cac6
fix: 'ckan.plugins' has no attribute 'IRoutes' it was added to the m…
kovalch c5422b0
feat: Use IPackageController delete method compartible with Ckan2.11
kovalch 3b386c6
update: iribaker
bellisk cca33cc
fix: Update init file
kovalch 2880c97
feat: Remove unneeded configure() method
bellisk 0f3c65e
Merge branch 'upgrade_to_python3_ckan2_11' of https://github.com/open…
kovalch 1cd8dbf
feat: Migrate assets from fanstatic to webassets
kovalch 54baebb
fix: migrate to webassets
kovalch c99823f
fix: Add correct folder
kovalch c6198b7
fix: Use webassets.yml
kovalch 5e4bf61
tests: Update github actions for testing
bellisk c4a3f40
style: Blacken
bellisk edd23ec
style: Remove unneeded encoding statements
bellisk 00f4cc1
fix: Remove redefinition of imported constant
bellisk 49745ef
Revert "fix: Revrite get_activities"
bellisk 682a792
feat: Update templates for ckanext-showcase v1.8.3
bellisk 309e19b
feat: Get activity model from ckanext-activity
bellisk 53ca390
feat: Blacken
bellisk a8257ae
feat: Override template from CKAN core
bellisk e913c9b
feat: Translate titles of entities to delete
bellisk fe88ba2
chore: Remove unneeded template
bellisk bdac548
feat: Update template for CKAN 2.11
bellisk 78a4672
fix: Fix output name
kovalch abfb7c1
fix: Update location for css and js webassets
kovalch b1d2311
feat: Update group templates for CKAN 2.11
bellisk 79d230a
feat: Update stats template for CKAN 2.11
bellisk 66b1208
fix: Update assets name
kovalch 4c647e1
fix: Use names defined in webassets.yaml
kovalch 4b6dbd0
feat: Update group templates for CKAN 2.11
bellisk 86f18e0
feat: Override CKAN templates
bellisk dcd57e1
feat: Translate display name with scheming, use 'category' everywhere
bellisk 05c5e82
feat: Override CKAN 2.11 template
bellisk 1c1af93
feat: Refer to draft datasets, not private ones
bellisk 73ba111
feat: Update routes for CKAN 2.11
bellisk 1ca3ffc
feat: Update group template for CKAN 2.11
bellisk 14dce0c
feat: Update home templates for CKAN 2.11
bellisk d2eae57
feat: Update organization templates for CKAN 2.11
bellisk 4c77667
feat: Override CKAN core template
bellisk 7feb7a7
feat: Refer to adding distributions to dataset, not resources
bellisk 94be2e1
feat: Update package templates for CKAN 2.11
bellisk b630cbb
fix: Fix webassets
bellisk 6355494
fix: Make index.html extend from core CKAN index.html
bellisk 19cc46e
feat: Remove calls to c object, update routes for CKAN 2.11
bellisk ef06a02
style: Run isort
bellisk 4f9507e
feat: Update front page templates for CKAN 2.11
bellisk 2ab9b2b
feat: Update group templates to use group obj, not dict
bellisk c5e8a36
feat: Update harvest route
bellisk 0cbc7b3
feat: Update search form reset-search button
bellisk 3aa9568
feat: Override CKAN core template
bellisk e28c449
feat: Pass the group_dict to the search form on group page
bellisk e78742b
feat: Update routes for CKAN 2.11
bellisk e301361
feat: Update routes for CKAN 2.11
bellisk 7e3484b
chore: Temporarily remove link to harvest dashboard in header
bellisk d7bb4bf
tests: Temporarily require update branch of ckanext-subscribe
bellisk d9383d7
feat: Override template from CKAN core so we can translate it
bellisk 966d700
feat: Translate display name and description in org info
bellisk 85baae1
feat: Override CKAN 2.11 template
bellisk 0801198
feat: Display our breadcrumb snippet on org edit page
bellisk 5fac174
feat: Update templates for CKAN 2.11
bellisk 8656ed2
fix: Fix mixed-up group/group_dict references
bellisk a3d71dc
feat: Create blueprint for permalink
bellisk 0b68d3b
tests: Start updating tests for CKAN 2.11
bellisk 6d5c712
tests: Update tests (still WIP)
bellisk b956e93
fix: Temporarily remove xml-upload-button as the route is not working
bellisk 2131d4e
feat: Update interface method names
bellisk 0a3e510
feat: Update functions that talk to toolkit.request
bellisk 077f0b5
fix: Convert empty dates to None for saving in Solr
bellisk 2d09cac
fix: Fix function call
bellisk c208398
fix: Return redirect in perma blueprint
bellisk da5db33
tests: Clean index before tests and use ogdch_pkg plugin
bellisk 82680e0
tests: Use 'correct' egg name for ckanext-dcatapchharvest
bellisk 82619bd
feat: Update routes from other ckanexts
bellisk aae755d
tests: Update test
bellisk 5fa74fa
feat: Update package templates for CKAN 2.11
bellisk 6ba02c4
feat: Replace built-in unicode validator with validator_safe
bellisk 49d308c
feat: Update templates for CKAN 2.11
bellisk 8f3862a
chore: Remove no-longer-needed overwritten template
bellisk b7bc7a1
feat: Extend template from the one in ckanext-showcase
bellisk 8dae57f
feat: Update templates for CKAN 2.11
bellisk a0e553e
feat: Convert xml_upload controller to blueprint
bellisk 5016f0d
fix: Get get_action from toolkit, not ckan.logic
bellisk 21ead8e
feat: Update template
bellisk fb145d5
feat: Use unicode_safe validator from CKAN, not built-in
bellisk 6f8c9e0
feat: Override CKAN core group index blueprint
bellisk 7b6a9ba
feat: Disable pagination for organization index page
bellisk fb621f5
fix: Fix imports
bellisk 898a4d8
style: Run black on copied code
bellisk 5f6bddd
feat: Add url rule to org blueprint for index
bellisk a4026e4
fix: Remove unneeded overridden block
bellisk d67515c
feat: Remove unneeded code from copied CKAN view func
bellisk 288a7db
feat: Transform org list for user controller into blueprint
bellisk e2ac8cb
tests: Install ckanext-subscribe main branch for tests
bellisk c605100
fix: Make button default style instead of primary
bellisk e9cb4b2
fix: Don't pass in url_defaults, set variables in view func
bellisk 41f9901
feat: Extend HierarchyDisplay plugin in our own plugin
bellisk cbcec72
feat: Only call custom search logic on an organization page
bellisk 2f373a5
chore: Clean up unused interface implementations
bellisk 686b617
chore: Remove now-unneeded OgdchOrganizationController
bellisk a8be1ee
style: Remove unused local variable
bellisk 07fe7a3
chore: Remove unneeded OgdchGroupController
bellisk c6dfb5a
tests: Update tests
bellisk 74e088e
tests: Update test_logic.py
bellisk 9195267
tests: Update tests
bellisk c7a6803
fix: Remove doubled check
bellisk a2a2fe4
chore: Remove no-longer-needed fix
bellisk 2172b5e
tests: Return extra_datasets in fixture
bellisk 2ec18c7
tests: Add test for search with single specified field
bellisk 553868d
feat: Update Solr schema to index description field
bellisk 15d80e3
tests: Update subscribtion tests
bellisk e0360ce
feat: Add migration for ogdch_subscribe plugin
bellisk d31d9fb
tests: Update subscribtion tests
bellisk 3d46057
fix: Update check for organization controller
bellisk a6be57a
tests: Get first test for email contents working
bellisk 356a858
tests: Remove test for variable that's never used
bellisk 25b0fd2
tests: Update the rest of the subscription email tests
bellisk b369f49
fix: Fix comment for function
bellisk 3dac9fa
tests: Update tests for validators
bellisk 80ebeb5
tests: Require updated branch of ckanext-dcatapchharvest
bellisk 9999cb4
tests: Exclude tests/ folder from coverage checks
bellisk 600d9f3
tests: Update test.yml for Github tests
bellisk 8b9f2c6
tests: Update mock import
bellisk 1a89c90
tests: Use Python 3, CKAN 2.11 branch of ckanext-password-policy
bellisk 1714697
tests: Enable more plugins in test.ini
bellisk b9012b4
tests: Update used plugins and order of enabling them
bellisk d40ad7a
tests: Pass CKAN_SITE_URL env var into the ckan container
bellisk f697926
tests: Expect the right number of emails
bellisk ff6b473
tests: Set config value smtp.mail_from to our expected value
bellisk f45e795
tests: Fix Solr volume paths
bellisk d3f9d19
feat: Update Solr config to match the one in use
bellisk 6273f9b
style: Only ignore 'too complex' flake8 error
bellisk b2f470d
feat: Catch KeyError when there is no current request
bellisk 77990ff
Merge pull request #351 from opendata-swiss/fix/fix-solr-config-and-i…
bellisk 63e23e4
feat: Handles missing keys safely
kovalch 5cfe10b
Merge pull request #352 from opendata-swiss/fix_missing_lang
kovalch 0d81667
test: Update requirements of ckanext-dcat
bellisk c485210
feat: Catch RuntimeError when creating a user in tests
bellisk 528b75f
feat: Allow higher versions of dev requirements
bellisk af434c8
feat: Increase supported versions of Python
bellisk e5468c9
tests: Remove unneeded migration command
bellisk 4882d92
refactor: use new route instead of deprecated search-route
stefina 32b96d5
feat: re-add harvest-dashboard to header-navigation
stefina c0069a9
Merge pull request #354 from opendata-swiss/feat/add-harvest-dashboard
stefina 8807000
Merge pull request #353 from opendata-swiss/feat/small-updates-for-ck…
bellisk 08dc450
fix: Use global CKAN template context to see the logged-in user
kovalch ba404b2
fix: Use c object to get dataset_type
kovalch 01319f0
feat: Use current_user to check sysadmin or authentication (flask-login)
bellisk 48f6ed6
feat: Update POST forms to include CSRF input
bellisk 190d030
fix: Fix html
bellisk e5e048d
fix: Remove unused imports
bellisk 227cac8
feat: Use current_user instead of g.user
bellisk 7f07946
feat: Use g instead of c, same as in ckan core
bellisk 94e00fa
feat: Remove reference to c, same as in ckan core
bellisk 8698878
feat: Add TODOs regarding the c object in templates
bellisk 3e4e111
Merge pull request #355 from opendata-swiss/use_c_user
bellisk e35b616
feat: Declare config options in yaml file
bellisk 175218f
chore: Remove obsolete helper function
bellisk 5f85f51
fix: Yamlify default values
bellisk 5fd78bf
fix: Only load config_declarations once, for OgdchPlugin
bellisk d6824e2
docs: Add comment to explain that the 'groups' don't do anything mean…
bellisk 4326cc4
tests: Use CKAN 2.11 Python 3 branch of ckanext-harvester_dashboard
bellisk de4e02d
Merge pull request #356 from opendata-swiss/feat/declare-config-options
bellisk bf9d49c
feat: Add ignore_missing to the validators
kovalch a3256c0
feat: Add ignore_missing to the validator of license
kovalch a558fac
feat: Add ignore_missing validator before field validator
kovalch 1ff0534
Merge pull request #358 from opendata-swiss/add_ignore_missing
kovalch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
omit = | ||
*/site-packages/* | ||
*/python?.?/* | ||
ckan/* | ||
ckan/* | ||
*/tests/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[settings] | ||
profile = black |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include README.rst | ||
recursive-include ckanext/switzerland *.html *.json *.js *.less *.css | ||
recursive-include ckanext/switzerland *.html *.json *.js *.less *.css *.yml | ||
recursive-include ckanext/switzerland/migration *.ini *.py *.mako |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# this is a namespace package | ||
try: | ||
import pkg_resources | ||
|
||
pkg_resources.declare_namespace(__name__) | ||
except ImportError: | ||
import pkgutil | ||
|
||
__path__ = pkgutil.extend_path(__path__, __name__) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.homepage .module-stats { | ||
/*margin-top: 1rem;*/ | ||
color: #444; | ||
} | ||
.homepage .module-stats .card { | ||
padding: 1.5rem 1.75rem; | ||
} | ||
.homepage .module-stats .card ul { | ||
margin: 0; | ||
list-style: none; | ||
padding: 0; | ||
} | ||
.homepage .module-stats .card ul::after { | ||
display: block; | ||
clear: both; | ||
content: ""; | ||
} | ||
.homepage .module-stats .card ul li { | ||
float: left; | ||
width: 25%; | ||
font-weight: 300; | ||
} | ||
.homepage .module-stats .card ul li a { | ||
display: block; | ||
} | ||
.homepage .module-stats .card ul li a strong { | ||
font-size: 0.875rem; | ||
line-height: 1.5; | ||
font-weight: bold; | ||
} | ||
.homepage .module-stats .card ul li a:hover { | ||
text-decoration: none; | ||
} | ||
.homepage .module-feeds .module-stats { | ||
margin-top: 0; | ||
} | ||
|
||
@media (max-width: 767.98px) { | ||
.homepage .module-stats { | ||
margin-top: 0.5rem; | ||
margin-bottom: 0.5rem; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
switzerland-css: | ||
output: switzerland/switzerland.css | ||
contents: | ||
- css/ogdch_file_upload.css | ||
- css/ogdch_form_helper.css | ||
- css/ogdch_organization_filter.css | ||
- css/ogdch_stats_box.css | ||
- vendor/bootstrap-datepicker/css/bootstrap-datepicker.css | ||
|
||
switzerland-js: | ||
output: switzerland/switzerland.js | ||
contents: | ||
- js/ogdch_file_upload.js | ||
- js/ogdch_form_helper_contact_points.js | ||
- js/ogdch_info_box.js | ||
- js/ogdch_form_helper_relations.js | ||
- js/ogdch_form_helper_qualified_relations.js | ||
- js/ogdch_form_helper_temporals.js | ||
- js/ogdch_datepicker.js | ||
- js/ogdch_organization_filter.js | ||
- vendor/bootstrap-datepicker/js/bootstrap-datepicker.js |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import logging | ||
from typing import Any | ||
|
||
import ckan.lib.base as base | ||
import ckan.logic as logic | ||
from ckan.common import _, current_user, request | ||
from ckan.lib.helpers import Page | ||
from ckan.lib.helpers import helper_functions as h | ||
from ckan.plugins.toolkit import get_action, redirect_to, request | ||
from ckan.types import Context | ||
from ckan.views.group import _get_group_template | ||
from flask import Blueprint | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
ValidationError = logic.ValidationError | ||
NotFound = logic.NotFound | ||
NotAuthorized = logic.NotAuthorized | ||
check_access = logic.check_access | ||
|
||
org = Blueprint( | ||
"ogdch_organization", | ||
__name__, | ||
url_prefix="/organization", | ||
) | ||
|
||
|
||
def xml_upload(name): | ||
org = get_action("organization_show")({}, {"id": name}) | ||
|
||
if request.files.get("file_upload") != "": | ||
data_dict = { | ||
"data": dict(request.files), | ||
"organization": org["id"], | ||
} | ||
get_action("ogdch_xml_upload")({}, data_dict) | ||
else: | ||
h.flash_error("Error uploading file: no data received.") | ||
|
||
return redirect_to("organization.read", id=name) | ||
|
||
|
||
def index() -> str: | ||
"""Copied from ckan.views.group.index to remove pagination on the organization | ||
index page, as it doesn't work well with the ckanext-hierarchy display. | ||
""" | ||
extra_vars: dict[str, Any] = {} | ||
page = h.get_page_number(request.args) or 1 | ||
group_type = "organization" | ||
is_organization = True | ||
|
||
context: Context = { | ||
"user": current_user.name, | ||
"for_view": True, | ||
"with_private": False, | ||
} | ||
|
||
try: | ||
action_name = "organization_list" if is_organization else "group_list" | ||
check_access(action_name, context) | ||
except NotAuthorized: | ||
base.abort(403, _("Not authorized to see this page")) | ||
|
||
q = request.args.get("q", "") | ||
sort_by = request.args.get("sort") | ||
|
||
extra_vars["q"] = q | ||
extra_vars["sort_by_selected"] = sort_by | ||
|
||
# pass user info to context as needed to view private datasets of | ||
# orgs correctly | ||
if current_user.is_authenticated: | ||
context["user_id"] = current_user.id | ||
context["user_is_admin"] = current_user.sysadmin # type: ignore | ||
|
||
try: | ||
data_dict_global_results: dict[str, Any] = { | ||
"all_fields": True, | ||
"q": q, | ||
"sort": sort_by, | ||
"type": group_type or "group", | ||
"include_dataset_count": True, | ||
"include_member_count": True, | ||
"include_extras": True, | ||
} | ||
|
||
action_name = "organization_list" if is_organization else "group_list" | ||
global_results = get_action(action_name)(context, data_dict_global_results) | ||
except ValidationError as e: | ||
if e.error_dict and e.error_dict.get("message"): | ||
msg: Any = e.error_dict["message"] | ||
else: | ||
msg = str(e) | ||
h.flash_error(msg) | ||
extra_vars["page"] = Page([], 0) | ||
extra_vars["group_type"] = group_type | ||
return base.render( | ||
_get_group_template("index_template", group_type), extra_vars | ||
) | ||
|
||
extra_vars["page"] = Page( | ||
collection=global_results, | ||
page=page, | ||
url=h.pager_url, | ||
items_per_page=len(global_results), | ||
) | ||
|
||
extra_vars["page"].items = global_results | ||
extra_vars["group_type"] = group_type | ||
return base.render(_get_group_template("index_template", group_type), extra_vars) | ||
|
||
|
||
org.add_url_rule("/xml_upload/<name>", view_func=xml_upload, methods=["POST"]) | ||
org.add_url_rule("/", view_func=index, strict_slashes=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
|
||
import ckan.logic as logic | ||
from ckan.plugins.toolkit import _, abort, get_action, redirect_to | ||
from flask import Blueprint | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
NotFound = logic.NotFound | ||
|
||
perma = Blueprint("perma", __name__, url_prefix="/perma") | ||
|
||
|
||
def read(id): | ||
""" | ||
This action redirects requests to /perma/{identifier} to | ||
the corresponding /dataset/{slug} route | ||
""" | ||
try: | ||
dataset = get_action("ogdch_dataset_by_identifier")( | ||
{"for_view": True}, {"identifier": id} | ||
) | ||
# redirect to dataset detail page | ||
return redirect_to("dataset.read", id=dataset["name"]) | ||
except NotFound: | ||
abort(404, _("Dataset not found")) | ||
|
||
|
||
perma.add_url_rule("/<id>", view_func=read) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.