it's possible to ask answer even if answers is not enabled for a project

Bug #860565 reported by Alexander Belchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Curtis Hovey

Bug Description

If some project has not enabled answers then user still can ask questions clicking on Bugs tab and then use right panel links:
Report a bug
Ask a question

Clicking on Ask a question will open the corresponding form and one can enter the question. I've filed question https://answers.launchpad.net/bzr-tiplog/+question/172456 in such way and even got mail notification, but there is no way to find this question via Answers tab, Launchpad says:
Launchpad does not know where bzr-tiplog tracks support requests.

Related branches

Aaron Bentley (abentley)
Changed in launchpad:
status: New → Triaged
importance: Undecided → High
Curtis Hovey (sinzui)
tags: added: answers bugs ui
tags: added: questions
removed: answers
Changed in launchpad:
importance: High → Low
Revision history for this message
Curtis Hovey (sinzui) wrote :

The defect is in BugTaskSearchListingView.addquestion_url which wrongly checks if there is a URL for asking a question. The object type is checked if it is a valid question target, but there is not check if the project uses Lp answers. The correct test is:
    @property
    def addquestion_url(self):
        """Return the URL for the +addquestion view for the context."""
        if IQuestionTarget.providedBy(self.context):
            answers_usage = IServiceUsage(self.context).answers_usage
            if answers_usage == ServiceUsage.LAUNCHPAD:):
                return canonical_url(
                    self.context, rootsite='answers',
                    view_name='+addquestion')
        else:
            return None

Changed in launchpad:
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
tags: added: trivial
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.