Merge lp:~sinzui/launchpad/ask-question-from-bug into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 14074 |
Proposed branch: | lp:~sinzui/launchpad/ask-question-from-bug |
Merge into: | lp:launchpad |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~sinzui/launchpad/ask-question-from-bug |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
j.c.sackett (community) | Approve | ||
Review via email: mp+77562@code.launchpad.net |
Description of the change
Disable ask/convert to question in Bugs when the project does not use Answers.
Launchpad bug: https:/
Pre-
If some project has not enabled answers then user still can ask questions
clicking on Bugs tab using the "Ask a question" link.
I saw this bug reported and knew it could be fixed in a few minutes. I also
realised that the convert to question rules probably ignored Answers too.
-------
RULES
* Update the view to return None for the addquestion URL when the
pillar does not use Answers.
* Update the canBeAQuestion() method to check that the pillar uses
answers.
QA
* Visit https:/
* Verify "Ask a question" is not an action in the side bar.
* Visit any bug with only one task
* Verify the "Convert to question" action is not in the side bar.
LINT
lib/
lib/
lib/
lib/
lib/
TEST
./bin/test -vvc -t TestBugTaskSear
./bin/test -vvc lp.bugs.
IMPLEMENTATION
Return None for in addquestion_url() when the pillar does not use Answers.
lib/
lib/
Return False for in canBeAQuestion() when the pillar does not use Answers.
Adding a new test to bugtarget-
the test. I decided to replace the section in the doctest with a unittest.
lib/
lib/
lib/
So, this isn't necessary to fix, but while you can set official_answers to False to make it not use launchpad, you could also set the answers_usage attribute directly with a value from the ServiceUsage enum, which is more in line with how the code elsewhere sets it (or is *supposed* to set it, in any event).