Skip to content
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

Avoiding Nikola trying to cache posts which aren't written anyway. #2031

Merged
merged 2 commits into from Sep 6, 2015

Conversation

@felixfontein
Copy link
Contributor

felixfontein commented Sep 6, 2015

If SHOW_UNTRANSLATED_POSTS is set to False and a post's translation doesn't exist, Nikola nonetheless tries to create the cached post every time nikola build is run. Since it never creates it anyway (as it notices that the translation isn't available and SHOW_UNTRANSLATED_POSTS is set to False -- there's identical code to the one I inserted in Post.compile which simply returns in this condition), there's no need to schedule a task for it.

@felixfontein felixfontein added the bug label Sep 6, 2015
@@ -77,6 +77,8 @@ def tl_ch():
deps_dict = copy(kw)
deps_dict.pop('timeline')
for post in kw['timeline']:
if not post.is_translation_available(lang) and not self.site.config['SHOW_UNTRANSLATED_POSTS']:
return

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 6, 2015

Member

That won’t do, it will kill the task generator for all posts. Try continue.

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 6, 2015

Author Contributor

Yikes, that's what I wanted to do. Thanks for catching this!

Kwpolska added a commit that referenced this pull request Sep 6, 2015
Avoiding Nikola trying to cache posts which aren't written anyway.
@Kwpolska Kwpolska merged commit e971b1c into master Sep 6, 2015
0 of 3 checks passed
0 of 3 checks passed
continuous-integration/appveyor Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@Kwpolska Kwpolska deleted the fix-untranslated-post-build branch Sep 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.