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

Make warnings on translate page more consistent in tests #2835

Merged
merged 2 commits into from Apr 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion kitsune/wiki/jinja2/wiki/translate.html
Expand Up @@ -56,7 +56,7 @@
</li>
{% endif %}
{% if more_updated_rev %}
<li class="warning">
<li class="warning draft-warning">
<p><strong>{{ _('This version is outdated, but there is a new version <a href="{link}">{revision}</a> available.')|fe(link=url('wiki.revision', document.slug, more_updated_rev.id, locale=locale), revision=more_updated_rev.id) }}</strong></p>
</li>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion kitsune/wiki/tests/test_templates.py
Expand Up @@ -1144,7 +1144,7 @@ def test_warning_showing_while_new_revision(self):
trans_resp = self.client.get(trans_url, draft_request)
trans_content = pq(trans_resp.content)
# Check there is a warning message
eq_(1, len(trans_content('.user-messages li')))
eq_(1, len(trans_content('.user-messages li.draft-warning')))


class HistoryTests(TestCaseBase):
Expand Down
3 changes: 1 addition & 2 deletions kitsune/wiki/views.py
Expand Up @@ -1517,8 +1517,7 @@ def _get_next_url_fallback_localization(request):

def _show_revision_warning(document, revision):
if revision:
return document.revisions.filter(created__gt=revision.created,
reviewed=None).exists()
return document.revisions.filter(id__gt=revision.id, reviewed=None).exists()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is Awesome for Future work. Thanks a lot!

return False


Expand Down