Skip to content

Commit cc950d1

Browse files
committed
https://github.com/smurfix/flask-script/pull/104
1 parent e92916b commit cc950d1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

flask_script/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,20 @@ def __call__(self, app=None, **kwargs):
143143
144144
If your sub-Manager does not override this, any values for options will get lost.
145145
"""
146-
if app is None:
147-
app = self.app
146+
if self.app is None:
148147
if app is None:
149148
raise Exception("There is no app here. This is unlikely to work.")
149+
self.app = app
150+
elif app is not None:
151+
kwargs['app'] = app
150152

151-
if isinstance(app, Flask):
153+
if isinstance(self.app, Flask):
152154
if kwargs:
153155
import warnings
154156
warnings.warn("Options will be ignored.")
155-
return app
157+
return self.app
156158

157-
app = app(**kwargs)
159+
app = self.app(**kwargs)
158160
self.app = app
159161
return app
160162

0 commit comments

Comments
 (0)