Fix url_for for api endpoints.
This commit is contained in:
parent
535947a06d
commit
bb2767ff16
4 changed files with 14 additions and 15 deletions
|
@ -1,10 +1,10 @@
|
|||
import json
|
||||
|
||||
from flask import request, url_for
|
||||
from flask import request
|
||||
from flask.ext.restful import abort
|
||||
|
||||
from endpoints.api import (RepositoryParamResource, nickname, resource, require_repo_admin,
|
||||
log_action, validate_json_request)
|
||||
log_action, validate_json_request, api)
|
||||
from data import model
|
||||
|
||||
|
||||
|
@ -36,8 +36,7 @@ class WebhookList(RepositoryParamResource):
|
|||
resp = webhook_view(webhook)
|
||||
repo_string = '%s/%s' % (namespace, repository)
|
||||
headers = {
|
||||
'Location': url_for('api_bp.get_webhook', repository=repo_string,
|
||||
public_id=webhook.public_id),
|
||||
'Location': api.url_for(Webhook, repository=repo_string, public_id=webhook.public_id),
|
||||
}
|
||||
log_action('add_repo_webhook', namespace,
|
||||
{'repo': repository, 'webhook_id': webhook.public_id},
|
||||
|
|
Reference in a new issue