Permalink
Browse files

Fix Bug 1125011 - Non-existent security advisory translations are not…

… redirected to en-US
  • Loading branch information...
1 parent 42c7a4b commit d4c2f16d784db523a745d5935a170b28ff3c1a83 @kyoshino kyoshino committed Jan 27, 2015
Showing with 5 additions and 4 deletions.
  1. +5 −4 bedrock/security/views.py
@@ -11,6 +11,7 @@
from funfactory.urlresolvers import reverse
from product_details import product_details
from product_details.version_compare import Version
+from lib.l10n_utils import LangFilesMixin
from bedrock.mozorg.decorators import cache_control_expires
from bedrock.security.models import Product, SecurityAdvisory
@@ -101,7 +102,7 @@ def latest_advisory(request, *args, **kwargs):
return latest.last_modified
-class AdvisoriesView(ListView):
+class AdvisoriesView(LangFilesMixin, ListView):
template_name = 'security/advisories.html'
queryset = SecurityAdvisory.objects.only('id', 'impact', 'title', 'announced')
context_object_name = 'advisories'
@@ -112,7 +113,7 @@ def dispatch(self, request, *args, **kwargs):
return super(AdvisoriesView, self).dispatch(request, *args, **kwargs)
-class AdvisoryView(DetailView):
+class AdvisoryView(LangFilesMixin, DetailView):
model = SecurityAdvisory
template_name = 'security/advisory.html'
context_object_name = 'advisory'
@@ -123,7 +124,7 @@ def dispatch(self, request, *args, **kwargs):
return super(AdvisoryView, self).dispatch(request, *args, **kwargs)
-class ProductView(ListView):
+class ProductView(LangFilesMixin, ListView):
template_name = 'security/product-advisories.html'
context_object_name = 'product_versions'
allow_empty = False
@@ -152,7 +153,7 @@ def get_context_data(self, **kwargs):
return cxt
-class ProductVersionView(ListView):
+class ProductVersionView(LangFilesMixin, ListView):
template_name = 'security/product-advisories.html'
context_object_name = 'product_versions'
allow_empty = False

0 comments on commit d4c2f16

Please sign in to comment.