-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #432 - Derive bug title summary from selected radio choice
- Loading branch information
Mike Taylor
committed
Mar 5, 2015
1 parent
e6de093
commit af9f3c3
Showing
1 changed file
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
problem_choices = [ | ||
(u'detection_bug', u'Desktop site instead of mobile site'), | ||
(u'mobile_site_bug', u'Mobile site is not usable'), | ||
(u'video_bug', u'Video does\'nt play'), | ||
(u'video_bug', u'Video doesn\'t play'), | ||
(u'layout_bug', u'Layout is messed up'), | ||
(u'text_bug', u'Text is not visible'), | ||
(u'unknown_bug', u'Somethign else - I\'ll add details below') | ||
|
@@ -64,6 +64,14 @@ def get_problem(category): | |
return u'Unknown' | ||
|
||
|
||
def get_problem_summary(category): | ||
'''Allows us to special case the "Other" radio choice summary.''' | ||
if category == 'unknown_bug': | ||
return u'see bug description' | ||
else: | ||
return get_problem(category).lower() | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
karlcow
Member
|
||
|
||
|
||
def wrap_label(label): | ||
'''Helper method to wrap a label and its type in an HTML comment. | ||
|
@@ -138,10 +146,11 @@ def build_formdata(form_object): | |
normalized_url = normalize_url(url) | ||
# Domain extraction | ||
domain = domain_name(normalized_url) | ||
problem_summary = get_problem_summary(form_object.get('problem_category')) | ||
if domain: | ||
summary = '{0} - {1}'.format(domain, form_object.get('summary')) | ||
summary = '{0} - {1}'.format(domain, problem_summary) | ||
else: | ||
summary = '{0}'.format(form_object.get('summary')) | ||
summary = '{0} - {1}'.format(normalized_url, problem_summary) | ||
# Preparing the body | ||
body = u'''{browser_label}{ua_label} | ||
**URL**: {url} | ||
|
@@ -160,6 +169,6 @@ def build_formdata(form_object): | |
description=form_object.get('description') | ||
) | ||
result = {} | ||
result['title'] = 'TODO: Get the title from the selected choice' | ||
result['title'] = summary | ||
result['body'] = body | ||
return result |
@miketaylr Working on #1587 I have a question about this one.
.lower()
is used here.get_problem()
doesn't make the string lowercase, butget_problem_summary()
does. Any reasons?