Merge pull request #1697 from kyoshino/bug-860865-sysreq-redirect-404

Bug 860865 followup, fix 404s on firefox/*/system-requirements
This commit is contained in:
Paul McLanahan 2014-02-14 11:51:46 -05:00
Родитель f2605861ce 8628088e28
Коммит 0e8cac3069
4 изменённых файлов: 15 добавлений и 14 удалений

Просмотреть файл

@ -765,23 +765,23 @@ class TestSysreqRedirect(TestCase):
@patch.dict(product_details.firefox_versions,
LATEST_FIREFOX_VERSION='22.0')
def test_desktop_release_version(self):
self._test('/firefox/system-requirements',
self._test('/firefox/system-requirements/',
'/firefox/22.0/system-requirements/')
@patch.dict(product_details.firefox_versions,
LATEST_FIREFOX_DEVEL_VERSION='23.0b1')
def test_desktop_beta_version(self):
self._test('/firefox/beta/system-requirements',
self._test('/firefox/beta/system-requirements/',
'/firefox/23.0beta/system-requirements/')
@patch.dict(product_details.firefox_versions,
FIREFOX_AURORA='24.0a2')
def test_desktop_aurora_version(self):
self._test('/firefox/aurora/system-requirements',
self._test('/firefox/aurora/system-requirements/',
'/firefox/24.0a2/system-requirements/')
@patch.dict(product_details.firefox_versions,
FIREFOX_ESR='24.2.0esr')
def test_desktop_esr_version(self):
self._test('/firefox/organizations/system-requirements',
self._test('/firefox/organizations/system-requirements/',
'/firefox/24.0/system-requirements/')

Просмотреть файл

@ -32,7 +32,7 @@ urlpatterns = patterns('',
url('^(?:%s)/(?:%s/)?notes/$' % (product_re, channel_re),
views.latest_notes, name='firefox.notes'),
url('^firefox/latest/releasenotes/$', views.latest_notes),
url('^firefox/(?:%s/)?system-requirements/?$' % channel_re,
url('^firefox/(?:%s/)?system-requirements/$' % channel_re,
views.latest_sysreq, name='firefox.sysreq'),
page('firefox/memory', 'firefox/memory.html'),
page('firefox/mobile/features', 'firefox/mobile/features.html'),

Просмотреть файл

@ -550,17 +550,17 @@ class TestProductURL(TestCase):
def test_firefox_sysreq(self):
"""Should return a reversed path for the Firefox sysreq page"""
eq_(self._render('firefox', 'sysreq'),
'/en-US/firefox/system-requirements')
'/en-US/firefox/system-requirements/')
eq_(self._render('firefox', 'sysreq', 'release'),
'/en-US/firefox/system-requirements')
'/en-US/firefox/system-requirements/')
eq_(self._render('firefox', 'sysreq', 'beta'),
'/en-US/firefox/beta/system-requirements')
'/en-US/firefox/beta/system-requirements/')
eq_(self._render('firefox', 'sysreq', 'aurora'),
'/en-US/firefox/aurora/system-requirements')
'/en-US/firefox/aurora/system-requirements/')
eq_(self._render('firefox', 'sysreq', 'esr'),
'/en-US/firefox/organizations/system-requirements')
'/en-US/firefox/organizations/system-requirements/')
eq_(self._render('firefox', 'sysreq', 'organizations'),
'/en-US/firefox/organizations/system-requirements')
'/en-US/firefox/organizations/system-requirements/')
def test_firefox_notes(self):
"""Should return a reversed path for the Firefox notes page"""

Просмотреть файл

@ -247,9 +247,10 @@ RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?mobile/customize(?:/.*)?$ /$1firefox/mobile/
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?products(/?)$ /b/$1products$2 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox(/(?:\d+\.\d+\.?(?:\d+)?\.?(?:\d+)?(?:[a|b]?)(?:\d*)(?:pre)?(?:\d)?))?/whatsnew(/?)$ /b/$1firefox$2/whatsnew$3 [PT]
# bug 736934
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?(firefox|mobile)/((?:aurora|beta)/)?notes(/?)$ /b/$1$2/$3notes$4 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox/system-requirements(\.html)?$ /b/$1firefox/system-requirements$2 [PT]
# bug 736934, 860865
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?(firefox|mobile)/((?:beta|aurora|organizations)/)?notes(/?)$ /b/$1$2/$3notes$4 [PT]
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox/((?:beta|aurora|organizations)/)?system-requirements(\.html)?$ /$1firefox/$2system-requirements/ [L,R=301]
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox/((?:beta|aurora|organizations)/)?system-requirements/$ /b/$1firefox/$2system-requirements/ [PT]
# bug 778752
RewriteRule ^/en-US/firefox/channel/android(/?)$ /b/en-US/firefox/channel/android$1 [PT]