block out consumer pages (bug 724592)
This commit is contained in:
Родитель
cafeae8f9e
Коммит
309f967d46
|
@ -240,6 +240,20 @@ class LoginRequiredMiddleware(ViewMiddleware):
|
||||||
settings.LOGIN_URL))
|
settings.LOGIN_URL))
|
||||||
|
|
||||||
|
|
||||||
|
class NoConsumerMiddleware(ViewMiddleware):
|
||||||
|
"""
|
||||||
|
Suprisingly similar to the other middleware, except on finding a match
|
||||||
|
it renders a page and has a bigger list of things we don't like.
|
||||||
|
Even more temporary. Maybe even more dragons.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||||
|
name = self.get_name(view_func)
|
||||||
|
if name.startswith(settings.NO_ADDONS_MODULES +
|
||||||
|
settings.NO_CONSUMER_MODULES):
|
||||||
|
return jingo.render(request, 'site/no_consumer.html')
|
||||||
|
|
||||||
|
|
||||||
class NoAddonsMiddleware(ViewMiddleware):
|
class NoAddonsMiddleware(ViewMiddleware):
|
||||||
"""
|
"""
|
||||||
If enabled will try and stop any requests to addons by 404'ing them.
|
If enabled will try and stop any requests to addons by 404'ing them.
|
||||||
|
|
|
@ -1363,15 +1363,6 @@ CELERY_DISABLE_RATE_LIMITS = True
|
||||||
# if you want to experience app-preview.mozilla.org.
|
# if you want to experience app-preview.mozilla.org.
|
||||||
APP_PREVIEW = False
|
APP_PREVIEW = False
|
||||||
|
|
||||||
# Specific view modules and methods that we don't want to force login on.
|
|
||||||
NO_LOGIN_REQUIRED_MODULES = (
|
|
||||||
'csp.views.policy',
|
|
||||||
'csp.views.report',
|
|
||||||
'django.views.i18n.javascript_catalog',
|
|
||||||
'django.contrib.auth.views.password_reset',
|
|
||||||
'django.contrib.auth.views.password_reset_done'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Sets an upper limit on the number of users. If 0, it's ignored. If the
|
# Sets an upper limit on the number of users. If 0, it's ignored. If the
|
||||||
# number of users meets or exceeds this, they can't register.
|
# number of users meets or exceeds this, they can't register.
|
||||||
REGISTER_USER_LIMIT = 0
|
REGISTER_USER_LIMIT = 0
|
||||||
|
@ -1380,16 +1371,6 @@ REGISTER_USER_LIMIT = 0
|
||||||
# bypass the limit by adding ?ro=mozillians to the URL.
|
# bypass the limit by adding ?ro=mozillians to the URL.
|
||||||
REGISTER_OVERRIDE_TOKEN = None
|
REGISTER_OVERRIDE_TOKEN = None
|
||||||
|
|
||||||
NO_ADDONS_MODULES = (
|
|
||||||
'addons.views',
|
|
||||||
'devhub.views.dashboard', # The apps dashboard is a different view.
|
|
||||||
'devhub.views.submit', # Addon submit not ok, app submit a-ok.
|
|
||||||
'browse.views.personas',
|
|
||||||
'browse.views.extensions',
|
|
||||||
'browse.views.language_tools',
|
|
||||||
'browse.views.themes',
|
|
||||||
)
|
|
||||||
|
|
||||||
# Cron jobs that aren't critical will check this flag and not run if this
|
# Cron jobs that aren't critical will check this flag and not run if this
|
||||||
# is True.
|
# is True.
|
||||||
IGNORE_NON_CRITICAL_CRONS = False
|
IGNORE_NON_CRITICAL_CRONS = False
|
||||||
|
|
|
@ -4,4 +4,43 @@ APP_PREVIEW = True
|
||||||
ROOT_URLCONF = 'mkt.urls'
|
ROOT_URLCONF = 'mkt.urls'
|
||||||
TEMPLATE_DIRS = (path('mkt/templates'),) + TEMPLATE_DIRS
|
TEMPLATE_DIRS = (path('mkt/templates'),) + TEMPLATE_DIRS
|
||||||
POTCH_MARKETPLACE_EXPERIMENTS = False
|
POTCH_MARKETPLACE_EXPERIMENTS = False
|
||||||
INSTALLED_APPS = INSTALLED_APPS + ('mkt.experiments',)
|
INSTALLED_APPS += ('mkt.experiments', 'mkt.site')
|
||||||
|
|
||||||
|
NO_ADDONS_MODULES = (
|
||||||
|
'addons.views',
|
||||||
|
'devhub.views.dashboard', # The apps dashboard is a different view.
|
||||||
|
'devhub.views.submit', # Addon submit not ok, app submit a-ok.
|
||||||
|
'browse.views.personas',
|
||||||
|
'browse.views.extensions',
|
||||||
|
'browse.views.language_tools',
|
||||||
|
'browse.views.themes',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Next level, no consumer for you!
|
||||||
|
NO_CONSUMER_MODULES = (
|
||||||
|
'api',
|
||||||
|
'bandwagon.views',
|
||||||
|
'browse.views',
|
||||||
|
'compat.views',
|
||||||
|
'discovery.views',
|
||||||
|
'editors.views',
|
||||||
|
'files.views',
|
||||||
|
'market.views',
|
||||||
|
'piston',
|
||||||
|
'users.views.purchases',
|
||||||
|
'users.views.payments',
|
||||||
|
'search.views',
|
||||||
|
'sharing.views',
|
||||||
|
'tags.views',
|
||||||
|
'versions.views',
|
||||||
|
'webapps.views',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Specific view modules and methods that we don't want to force login on.
|
||||||
|
NO_LOGIN_REQUIRED_MODULES = (
|
||||||
|
'csp.views.policy',
|
||||||
|
'csp.views.report',
|
||||||
|
'django.views.i18n.javascript_catalog',
|
||||||
|
'django.contrib.auth.views.password_reset',
|
||||||
|
'django.contrib.auth.views.password_reset_done'
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% extends "impala/base.html" %}
|
||||||
|
|
||||||
|
{% block title %}{{ loc('Mozilla Marketplace') }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<section>
|
||||||
|
<p class="island">Sorry, these pages for the Mozilla Marketplace aren't ready yet.</p>
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
Загрузка…
Ссылка в новой задаче