Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Commit

Permalink
Fixes bug 802954 - Completed query results text with missing informat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
adngdb committed Oct 18, 2012
1 parent 15c4c95 commit 87b8299
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
18 changes: 17 additions & 1 deletion crashstats/crashstats/templates/crashstats/query.html
Expand Up @@ -163,7 +163,23 @@ <h2>Query Results</h2>
<div class="body notitle">
{% if query.total > 0 %}
<p>
Results within {{ params.date_range_value }} {{ params.date_range_unit }} of {{ params.end_date }}, and the product is one of {{ ', '.join(params.products) }}, and the version is one of {{ ', '.join(params.versions) }} and the crashing process was of {{ params.process_type }} type (including unofficial release channels).</p>
Results within {{ params.date_range_value }} {{ params.date_range_unit }} of {{ params.end_date }}
{%- if params.query %}
where the crash signature {{ params.query_type|replace('_', ' ') }} '{{ params.query }}'
{%- endif -%}
{% for field in ['product', 'version', 'platform'] %}
{%- if params[field + 's'] -%}
, and the {{ field }} is one of {{ ', '.join(params[field + 's']) }}
{%- endif -%}
{% endfor %}
{%- if params.process_type == 'any' -%}
, and the crashing process was of any type (including unofficial release channels)
{%- else -%}
, and the crashing process was a {{ params.process_type }}
{% if params.process_type == 'plugin' and params.plugin_query %}
and its {{ params.plugin_field }} {{ params.plugin_query_type|replace('_', ' ') }} {{ params.plugin_query }}
{%- endif -%}
{%- endif -%}.</p>

{{ pagination(query) }}

Expand Down
10 changes: 8 additions & 2 deletions crashstats/crashstats/views.py
Expand Up @@ -949,12 +949,18 @@ def query(request):

# If the query looks like an ooid and the form was the simple one, go to
# report/index directly, without running a search.
if form.cleaned_data['query_type'] == 'simple':
query_type = form.cleaned_data['query_type']
if query_type == 'simple':
ooid = utils.has_ooid(form.cleaned_data['query'])
if ooid:
url = reverse('crashstats.report_index',
kwargs=dict(crash_id=ooid))
return redirect(url)
# The 'simple' value is a special case used only with the form on top
# of our pages. It should be turned into 'contains' before doing
# anything else as 'simple' as a query type makes no sense for the
# middleware.
query_type = 'contains'

results_per_page = 100
data = {}
Expand Down Expand Up @@ -988,7 +994,7 @@ def query(request):
'end_date': form.cleaned_data['date'],
'date_range_unit': form.cleaned_data['range_unit'],
'date_range_value': form.cleaned_data['range_value'],
'query_type': form.cleaned_data['query_type'],
'query_type': query_type,
'reason': form.cleaned_data['reason'],
'build_id': form.cleaned_data['build_id'],
'process_type': form.cleaned_data['process_type'],
Expand Down

0 comments on commit 87b8299

Please sign in to comment.