odd use of feature flags

Bug #641725 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Michael Nelson

Bug Description

in distroseries.py, for the new differences stuff

    def initialize(self):
        """Redirect to the derived series if the feature is not enabled."""
        def in_scope(value):
            return True

        feature_controller = FeatureController(in_scope)
        if feature_controller.getFlag('soyuz.derived-series-ui.enabled') != 'on':
            self.request.response.redirect(canonical_url(self.context))
            return
        super(DistroSeriesLocalDifferences, self).initialize()

This is buggy - it will match too many scopes, and its also way more code than is needed.

This is better:

    def initialize(self):
        """Redirect to the derived series if the feature is not enabled."""
       if features.getFeatureFlag('oyuz.derived-series-ui.enabled'):
           self.request.response.redirect(canonical_url(self.context))
           return
      super(DistroSeriesLocalDifferences, self).initialize()

Related branches

Changed in soyuz:
status: New → In Progress
milestone: none → 10.10
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in soyuz:
status: In Progress → Fix Committed
tags: added: qa-untestable
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in soyuz:
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.