Fix action wrapper
The action wrapper was using an unbound function - it now passes the extension object as self. We were incorrectly passing endpoint names as positional arguments - this is fixed and I now use a keyword argument.
This commit is contained in:
parent
d7d7a8cc8d
commit
040d7d4ba6
1 changed files with 2 additions and 2 deletions
|
|
@ -216,7 +216,7 @@ def extension_action(args=None):
|
|||
|
||||
def post(self, arguments):
|
||||
# Run the action
|
||||
return func(**arguments)
|
||||
return func(self.extension, **arguments)
|
||||
|
||||
def get(self, *args, **kwargs): # pylint: disable=useless-super-delegation
|
||||
# Explicitly wrap the `get` method to allow us to add a docstring
|
||||
|
|
@ -294,7 +294,7 @@ class AutofocusExtension(BaseExtension):
|
|||
obj = getattr(self, k)
|
||||
if hasattr(obj, "flask_view"):
|
||||
name = obj.__name__
|
||||
self.add_view(obj.flask_view, f"/{name}", name)
|
||||
self.add_view(obj.flask_view, f"/{name}", endpoint=name)
|
||||
|
||||
def measure_sharpness(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue