From 109a8160ecc74fbda87d219513ef519c103d696d Mon Sep 17 00:00:00 2001 From: Chris Van Date: Fri, 3 Jan 2014 10:42:50 -0800 Subject: [PATCH] remove "accept-webapps" waffle flag and "use_apps" AMO decorator --- apps/api/handlers.py | 3 --- apps/devhub/decorators.py | 12 ----------- apps/devhub/urls.py | 20 +++++++++---------- .../723-remove-accept-webapps-waffle.sql | 2 ++ 4 files changed, 11 insertions(+), 26 deletions(-) create mode 100644 migrations/723-remove-accept-webapps-waffle.sql diff --git a/apps/api/handlers.py b/apps/api/handlers.py index dc0b702043..840812752b 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -177,9 +177,6 @@ class AppsHandler(AddonsHandler): @transaction.commit_on_success def create(self, request): - if not waffle.flag_is_active(request, 'accept-webapps'): - return rc.BAD_REQUEST - form = NewManifestForm(request.POST) if form.is_valid(): # This feels like an awful lot of work. diff --git a/apps/devhub/decorators.py b/apps/devhub/decorators.py index 9f0fe7f6cd..3b0e70b701 100644 --- a/apps/devhub/decorators.py +++ b/apps/devhub/decorators.py @@ -3,8 +3,6 @@ import functools from django import http from django.core.exceptions import PermissionDenied -import waffle - from amo.decorators import login_required from access import acl from addons.decorators import addon_view @@ -57,13 +55,3 @@ def dev_required(owner_for_post=False, allow_editors=False, webapp=False, return decorator(f) else: return decorator - - -# Mark a view as a web app -def use_apps(f): - def wrapper(request, *args, **kwargs): - # This should be set to True when the waffle - # flag is removed! - show_webapp = waffle.flag_is_active(request, 'accept-webapps') - return f(request, *args, webapp=show_webapp, **kwargs) - return wrapper diff --git a/apps/devhub/urls.py b/apps/devhub/urls.py index 3a13ff5ee7..e44e852df1 100644 --- a/apps/devhub/urls.py +++ b/apps/devhub/urls.py @@ -3,10 +3,10 @@ from django.shortcuts import redirect from lib.misc.urlconf_decorator import decorate -from addons.urls import ADDON_ID import amo +from addons.urls import ADDON_ID from amo.decorators import write -from devhub.decorators import use_apps + from . import views PACKAGE_NAME = '(?P[_\w]+)' @@ -24,10 +24,10 @@ submit_patterns = patterns('', ) submit_apps_patterns = patterns('', - url('^3$', use_apps(views.submit_describe), name='devhub.submit_apps.3'), - url('^4$', use_apps(views.submit_media), name='devhub.submit_apps.4'), - url('^5$', use_apps(views.submit_done), name='devhub.submit_apps.5'), - url('^bump$', use_apps(views.submit_bump), name='devhub.submit_apps.bump'), + url('^3$', views.submit_describe, name='devhub.submit_apps.3'), + url('^4$', views.submit_media, name='devhub.submit_apps.4'), + url('^5$', views.submit_done, name='devhub.submit_apps.5'), + url('^bump$', views.submit_bump, name='devhub.submit_apps.bump'), ) @@ -183,10 +183,8 @@ urlpatterns = decorate(write, patterns('', # Web App submission url('^app/submit/$', lambda r: redirect('devhub.submit_apps.1', permanent=True)), - url('^app/submit/1$', use_apps(views.submit), - name='devhub.submit_apps.1'), - url('^app/submit/2$', use_apps(views.submit_addon), - name='devhub.submit_apps.2'), + url('^app/submit/1$', views.submit, name='devhub.submit_apps.1'), + url('^app/submit/2$', views.submit_addon, name='devhub.submit_apps.2'), # Standalone validator: url('^addon/validate/?$', views.validate_addon, @@ -207,7 +205,7 @@ urlpatterns = decorate(write, patterns('', url('^addons$', views.dashboard, name='devhub.addons'), url('^themes$', views.dashboard, name='devhub.themes', kwargs={'theme': True}), - url('^apps$', use_apps(views.dashboard), name='devhub.apps'), + url('^apps$', views.dashboard, name='devhub.apps'), url('^feed$', views.feed, name='devhub.feed_all'), # TODO: not necessary when devhub homepage is moved out of remora url('^feed/all$', lambda r: redirect('devhub.feed_all', permanent=True)), diff --git a/migrations/723-remove-accept-webapps-waffle.sql b/migrations/723-remove-accept-webapps-waffle.sql new file mode 100644 index 0000000000..bfc8e00638 --- /dev/null +++ b/migrations/723-remove-accept-webapps-waffle.sql @@ -0,0 +1,2 @@ +DELETE FROM waffle_flag_amo WHERE name = 'accept-webapps'; +DELETE FROM waffle_flag_mkt WHERE name = 'accept-webapps';