Skip to content

Commit

Permalink
Merge pull request mozilla-services#3126 from peterbe/bug-1231226-rem…
Browse files Browse the repository at this point in the history
…ove-waffle-switch-for-signature-report

fixes bug 1231226 - Remove waffle switch for signature report
  • Loading branch information
Peter Bengtsson committed Dec 9, 2015
2 parents d47e332 + be563e8 commit 1c23d32
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
35 changes: 0 additions & 35 deletions webapp-django/crashstats/signature/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from django.core.urlresolvers import reverse

from waffle.models import Switch

from crashstats.supersearch.models import SuperSearch
from crashstats.crashstats.tests.test_views import BaseTestViews, Response

Expand All @@ -16,39 +14,6 @@

class TestViews(BaseTestViews):

@classmethod
def setUpClass(cls):
super(cls, TestViews).setUpClass()
TestViews.switch = Switch.objects.create(
name='signature-report',
active=True,
)

@classmethod
def tearDownClass(cls):
TestViews.switch.delete()
super(cls, TestViews).tearDownClass()

def test_waffle_switch(self):
# Deactivate the switch to verify it's not accessible.
TestViews.switch.active = False
TestViews.switch.save()

url = reverse('signature:signature_report')
response = self.client.get(url)
eq_(response.status_code, 404)

url = reverse('signature:signature_reports')
response = self.client.get(url)
eq_(response.status_code, 404)

url = reverse('signature:signature_aggregation', args=('some_agg',))
response = self.client.get(url)
eq_(response.status_code, 404)

TestViews.switch.active = True
TestViews.switch.save()

def test_signature_report(self):
url = reverse('signature:signature_report')
response = self.client.get(url, {'signature': DUMB_SIGNATURE})
Expand Down
9 changes: 0 additions & 9 deletions webapp-django/crashstats/signature/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from django.shortcuts import render
from django.conf import settings

from waffle.decorators import waffle_switch

from crashstats.api.views import has_permissions
from crashstats.crashstats import models, utils
from crashstats.crashstats.views import pass_default_context
Expand Down Expand Up @@ -61,7 +59,6 @@ def inner(request, *args, **kwargs):
return inner


@waffle_switch('signature-report')
@pass_validated_params
@pass_default_context
def signature_report(request, params, default_context=None):
Expand Down Expand Up @@ -102,7 +99,6 @@ def signature_report(request, params, default_context=None):
return render(request, 'signature/signature_report.html', context)


@waffle_switch('signature-report')
@pass_validated_params
def signature_reports(request, params):
'''Return the results of a search. '''
Expand Down Expand Up @@ -191,7 +187,6 @@ def signature_reports(request, params):
return render(request, 'signature/signature_reports.html', data)


@waffle_switch('signature-report')
@pass_validated_params
def signature_aggregation(request, params, aggregation):
'''Return the aggregation of a field. '''
Expand Down Expand Up @@ -236,7 +231,6 @@ def signature_aggregation(request, params, aggregation):
return render(request, 'signature/signature_aggregation.html', data)


@waffle_switch('signature-report')
@utils.json_view
@pass_validated_params
def signature_graphs(request, params, field):
Expand Down Expand Up @@ -280,7 +274,6 @@ def signature_graphs(request, params, field):
return data


@waffle_switch('signature-report')
@pass_validated_params
def signature_comments(request, params):
'''Return a list of non-empty comments. '''
Expand Down Expand Up @@ -344,7 +337,6 @@ def signature_comments(request, params):
return render(request, 'signature/signature_comments.html', data)


@waffle_switch('signature-report')
@utils.json_view
@pass_validated_params
def signature_graph_data(request, params, channel):
Expand Down Expand Up @@ -413,7 +405,6 @@ def signature_graph_data(request, params, channel):
return data


@waffle_switch('signature-report')
@pass_validated_params
def signature_summary(request, params):
'''Return a list of specific aggregations. '''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,13 @@
{{ crash[column] | human_readable_iso_date }}
{% elif column == 'signature' %}
<a
{% if waffle.switch('signature-report') %}
href="{{ url('signature:signature_report') }}{{ change_query_string(
_no_base=True,
signature=crash.signature,
page=None,
_columns=None,
_facets=None
) }}"
{% else %}
href="{{ url('crashstats:report_list') }}?signature={{ crash.signature | urlencode }}&amp;{{ report_list_query_string }}"
{% endif %}
title="Click to leave this search and go to this signature report"
>
{{ crash[column] }}
Expand Down

0 comments on commit 1c23d32

Please sign in to comment.