Comments (3)
You're quite right.
How about changing it to:
api_url = urlparse.urljoin(context['site_url'] + '/', 'api/action')
Perhaps you could create some pull requests with this or similar change?
from ckanext-qa.
Yes I could. However, I'm not sure what the proper way to fix this. Sure your suggestion would work, but since this appears to be broken in other extensions as well, I was looking for a standard way to handle this... And looking into ckan source code, I could find a few different "solutions":
-
controllers/feed.py has
'/'.join([site_url, resource_path])
and alsobase_url + h.url_for(controller='package', ...)
-
controllers/package.py has
c.datastore_api = '%s/api/action' % \ config.get('ckan.site_url', '').rstrip('/')
similar things in lib/dictization/model_dictize.py or model/package.py -
lib/cli.py has
fetch_url = config['ckan.site_url'] url = h.url_for(controller='package', action='read', id=dd['name']) url = urlparse.urljoin(fetch_url, url[1:]) + '.rdf'
which, I guess, would also fail in case site_url has a path component.
Did I miss something or should we really go and fix all usages of urljoin the way you suggests?
from ckanext-qa.
site_url shouldn't have path components, that's what root_path is for. The url_for helper can be used to generate full paths correctly, I think.
from ckanext-qa.
Related Issues (20)
- Celery Queues in stock CKAN ? HOT 3
- Move openness-element outside of organization.html-snippet or contain it in a block HOT 2
- HelperError: relative_url_for has not been defined in openness.html line 40 HOT 5
- old kombu dependency HOT 1
- Is ckanext-report optional or not? HOT 1
- Import Error: from kombu import virtual HOT 1
- 'thread._local' object has no attribute 'host' HOT 1
- How ckanext-cloudstorage and ckanext-qa could work together? HOT 1
- Is OPENNESS_SCORE_DESCRIPTION used anywhere?
- Upgrade Celery to 3.x HOT 1
- Should TaskStatus be deleted after migration to 2.0?
- Move migrate_task_status.py to CLI paster command HOT 1
- from six import viewkeys: cannot import name viewkeys HOT 1
- ImportError: cannot import name __version__ HOT 2
- ckanext-qa does not show rating stars
- qa error: update_package' object has no attribute 'get_logger' HOT 16
- qa mistakes json for txt
- No rating stars in ckan 2.8 HOT 1
- Improve/start versioning
- QA rating without downloading files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ckanext-qa.