Example #1
0
 def __call__(self, feature):
     if not current_app:
         log.warn(
             u"Got a request to check for {feature} but we're outside the request"
             u"context. Returning False".format(feature=feature))
         return False
     if self.db.get(feature):
         return True
     raise NoFeatureFlagFound
Example #2
0
  def __call__(self, feature=None):
    if not current_app:
      log.warn(u"Got a request to check for {feature} but we're outside the request context. Returning False".format(feature=feature))
      return False

    try:
      return self.model.check(feature)
    except NoResultFound:
      raise NoFeatureFlagFound()
Example #3
0
    def __call__(self, feature=None):
        if not current_app:
            log.warn(
                "Got a request to check for {feature} but we're outside the request context. Returning False"
                .format(feature=feature))
            return False

        try:
            return self.model.check(feature)
        except NoResultFound:
            raise NoFeatureFlagFound()
    def __call__(self, feature):
        if not current_app:
            log.warn(
                "Got a request to check for {feature} but we're outside the request context. Returning False"
                .format(feature=feature))
            return False

        feature_cfg = "{prefix}_{feature}".format(prefix=FEATURE_FLAGS_CONFIG,
                                                  feature=feature)

        try:
            return current_app.config[feature_cfg]
        except KeyError:
            raise NoFeatureFlagFound()
    def __call__(self, feature):
        if not current_app:
            log.warn(
                u"Got a request to check for {feature} but we're outside the request context. Returning False".format(
                    feature=feature
                )
            )
            return False

        feature_cfg = "{prefix}_{feature}".format(prefix=FEATURE_FLAGS_CONFIG, feature=feature)

        try:
            return current_app.config[feature_cfg]
        except KeyError:
            raise NoFeatureFlagFound()