Skip to content

Commit

Permalink
Fix configuration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epandurski committed Jan 31, 2021
1 parent a774733 commit 096d06d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

Version 0.3.9
-------------

- Fixed a bug. The bug resulted in raising "tried to reconfigure an
already configured broker" error in case at least one configuration
option has been passed to the borker constructor, and the broker's
type is changed in the flask's configuration.


Version 0.3.8
-------------

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.8'
version = '0.3.9'
# The full version, including alpha/beta/rc tags.
release = '0.3.8'
release = '0.3.9'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -138,7 +138,7 @@
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'Flask-Melodramatiq v0.3.8'
# html_title = 'Flask-Melodramatiq v0.3.9'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down
3 changes: 2 additions & 1 deletion flask_melodramatiq/lazy_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self, app=None, config_prefix=DEFAULT_CONFIG_PREFIX, **options):
self.__config_prefix = config_prefix
self.__options = options
self.__configuration = None
self.__orig_class_name = type(self).__name__

# We want to be able to add middleware and declare actors
# before `init_app` is called. We do this by delegating to a
Expand Down Expand Up @@ -220,7 +221,7 @@ def add_middleware(self, middleware, *, before=None, after=None):
def __get_primary_options(self):
options = self.__options.copy()
options.pop('class', None)
class_name = type(self).__name__
class_name = self.__orig_class_name
if class_name in _broker_classes_registry:
options['class'] = class_name
return options
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def rel(*xs):

setup(
name='Flask-Melodramatiq',
version='0.3.8',
version='0.3.9',
url='https://github.com/epandurski/flask_melodramatiq',
license='MIT',
author='Evgeni Pandurski',
Expand Down

0 comments on commit 096d06d

Please sign in to comment.