-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WL-320: fixed get_template_path to work with absolute path also #11548
Conversation
26d3d96
to
b6e8ae6
Compare
jenkins run python |
b6e8ae6
to
070a142
Compare
jenkins run bokchoy |
@@ -312,6 +312,7 @@ def get_template_path(self, relative_path, **kwargs): | |||
from microsite_configuration.microsite import get_value as microsite_get_value | |||
|
|||
microsite_template_path = microsite_get_value('template_dir', None) | |||
relative_path = template_path[1:] if template_path.startswith('/') else template_path | |||
|
|||
if not microsite_template_path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for readability, let's move this block up to line 315 and move relative_path closer to search_path
fixed quality violation skipped test in CMS changes after feedback from mattd
a98e748
to
6cd2657
Compare
@mattdrayer made changes as you suggested. @felipemontoya would you like to review this PR too? |
Great, LGTM! 👍 |
LGTM 👍 |
WL-320: fixed get_template_path to work with absolute path also
I had a look at this, and its alright. In our fork we sometimes do need the leading slash when the path is a microsite template, but we have extended the BaseMicrositeTemplateBackend to support our usecase, so 👍 |
It has been discovered while PR #11076 that
get_template_path
inBaseMicrositeTemplateBackend
fails in case of absolute path. This PR has fix forget_template_path
inBaseMicrositeTemplateBackend
to accept both absolute and relative paths.@saleem-latif please review.
@mattdrayer @strannikk FYI.