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 2 commits into from Sep 6, 2015


Copy link

@felixfontein 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.

@@ -77,6 +77,8 @@ def tl_ch():
deps_dict = copy(kw)
for post in kw['timeline']:
if not post.is_translation_available(lang) and not['SHOW_UNTRANSLATED_POSTS']:
Copy link

@Kwpolska Kwpolska Sep 6, 2015

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

Copy link
Contributor Author

@felixfontein felixfontein Sep 6, 2015

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

Kwpolska added a commit that referenced this issue 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
@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
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants