|
1 | 1 | import importlib
|
2 | 2 | import threading
|
| 3 | +from collections.abc import Generator, Iterable, Mapping |
3 | 4 | from datetime import datetime, timedelta
|
4 | 5 | from json import dumps
|
5 | 6 | from typing import Any, Optional
|
6 |
| -from collections.abc import Generator, Iterable, Mapping |
| 7 | +from urllib.parse import quote_plus |
7 | 8 |
|
8 | 9 | import pyramid.httpexceptions as exc
|
9 | 10 | import pytz
|
|
15 | 16 | from pyramid.events import NewRequest
|
16 | 17 | from pyramid.request import Request
|
17 | 18 | from pyramid.response import Response
|
18 |
| -from urllib.parse import quote_plus |
19 | 19 |
|
| 20 | +from pyff import __version__ |
20 | 21 | from pyff.constants import config
|
21 | 22 | from pyff.exceptions import ResourceException
|
22 | 23 | from pyff.logs import get_log
|
|
25 | 26 | from pyff.resource import Resource
|
26 | 27 | from pyff.samlmd import entity_display_name
|
27 | 28 | from pyff.utils import b2u, dumptree, hash_id, json_serializer, utc_now
|
28 |
| -from pyff import __version__ |
29 | 29 |
|
30 | 30 | log = get_log(__name__)
|
31 | 31 |
|
@@ -131,7 +131,6 @@ def call(entry: str) -> None:
|
131 | 131 | resp = requests.post(url)
|
132 | 132 | if resp.status_code >= 300:
|
133 | 133 | log.error(f'POST request to API endpoint at {url} failed: {resp.status_code} {resp.reason}')
|
134 |
| - return None |
135 | 134 |
|
136 | 135 |
|
137 | 136 | def request_handler(request: Request) -> Response:
|
@@ -386,7 +385,7 @@ def _links(url: str, title: Any = None) -> None:
|
386 | 385 |
|
387 | 386 | for entity in request.registry.md.store.lookup('entities'):
|
388 | 387 | entity_display = entity_display_name(entity)
|
389 |
| - _links("/entities/%s" % hash_id(entity.get('entityID')), title=entity_display) |
| 388 | + _links("/entities/{}".format(hash_id(entity.get('entityID'))), title=entity_display) |
390 | 389 |
|
391 | 390 | aliases = request.registry.aliases
|
392 | 391 | for a in aliases.keys():
|
|
0 commit comments