Made it easier for extensions to register multiple blueprints at different URLs

The blueprint's own url_prefix='/xxx' setting is now taken into account.
This commit is contained in:
Sybren A. Stüvel 2016-09-07 11:40:24 +02:00
parent 8a6cd96198
commit f21b708085

View File

@ -197,7 +197,11 @@ class PillarServer(Eve):
# Load extension blueprint(s)
for blueprint in pillar_extension.blueprints():
self.register_blueprint(blueprint, url_prefix=url_prefix)
if blueprint.url_prefix:
blueprint_prefix = url_prefix + blueprint.url_prefix
else:
blueprint_prefix = url_prefix
self.register_blueprint(blueprint, url_prefix=blueprint_prefix)
# Load template paths
tpath = pillar_extension.template_path