Skip to content

Commit fb8bab5

Browse files
committed
Fix legacy modules check_username_for_spam
Broke in #17916, as the signature inspection incorrectly looks at the wrapper function. We fix this by setting the signature on the wrapper function to that of the wrapped function via `@functools.wraps`.
1 parent 37e8934 commit fb8bab5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

synapse/module_api/callbacks/spamchecker_callbacks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#
2020
#
2121

22+
import functools
2223
import inspect
2324
import logging
2425
from typing import (
@@ -297,6 +298,7 @@ def wrapper(
297298
"Bad signature for callback check_registration_for_spam",
298299
)
299300

301+
@functools.wraps(wrapped_func)
300302
def run(*args: Any, **kwargs: Any) -> Awaitable:
301303
# Assertion required because mypy can't prove we won't change `f`
302304
# back to `None`. See

0 commit comments

Comments
 (0)