From f21b70808565b752ce2a5efa842d530a9d03c79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 7 Sep 2016 11:40:24 +0200 Subject: [PATCH] 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. --- pillar/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pillar/__init__.py b/pillar/__init__.py index 24e543da..e385e54a 100644 --- a/pillar/__init__.py +++ b/pillar/__init__.py @@ -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