Skip to content

Commit

Permalink
Remove init_app's strict kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
underyx committed Jul 18, 2016
1 parent 0cc6026 commit dd6ea39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
History
=======

0.3.0 (unreleased)
-----------------

- **Backwards incompatible:** The ``FlaskRedis.init_app`` method no longer takes a ``strict`` parameter. Pass this flag
when creating your ``FlaskRedis`` instance, instead.

0.2.0 (4/15/2015)
-----------------

Expand Down
11 changes: 3 additions & 8 deletions flask_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class FlaskRedis(object):

def __init__(self, app=None, strict=False, config_prefix='REDIS'):
self._redis_client = None
self.provider_class = None
self.provider_class = redis.StrictRedis if strict else redis.Redis
self.config_prefix = config_prefix

if app is not None:
self.init_app(app, strict)
self.init_app(app)

@classmethod
def from_custom_provider(cls, provider, app=None, **kwargs):
Expand All @@ -31,12 +31,7 @@ def from_custom_provider(cls, provider, app=None, **kwargs):
instance.init_app(app)
return instance

def init_app(self, app, strict=False):
if self.provider_class is None:
self.provider_class = (
redis.StrictRedis if strict else redis.Redis
)

def init_app(self, app):
redis_url = app.config.get(
'{0}_URL'.format(self.config_prefix), 'redis://localhost:6379/0'
)
Expand Down

0 comments on commit dd6ea39

Please sign in to comment.