Exemplo n.º 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
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 4
0
    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()
Exemplo n.º 5
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 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()