Skip to content

Commit ae7c12e

Browse files
Remove unused mention handler attributes from routing decorator
1 parent cbcf411 commit ae7c12e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/django_github_app/routing.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,13 @@
2626
CB = TypeVar("CB", AsyncCallback, SyncCallback)
2727

2828

29-
class MentionHandlerBase(Protocol):
30-
_mention_pattern: str | re.Pattern[str] | None
31-
_mention_scope: MentionScope | None
32-
_mention_username: str | re.Pattern[str] | None
33-
34-
35-
class AsyncMentionHandler(MentionHandlerBase, Protocol):
29+
class AsyncMentionHandler(Protocol):
3630
async def __call__(
3731
self, event: sansio.Event, *args: Any, **kwargs: Any
3832
) -> None: ...
3933

4034

41-
class SyncMentionHandler(MentionHandlerBase, Protocol):
35+
class SyncMentionHandler(Protocol):
4236
def __call__(self, event: sansio.Event, *args: Any, **kwargs: Any) -> None: ...
4337

4438

@@ -103,10 +97,6 @@ def sync_wrapper(
10397
else:
10498
wrapper = cast(SyncMentionHandler, sync_wrapper)
10599

106-
wrapper._mention_pattern = pattern
107-
wrapper._mention_scope = scope
108-
wrapper._mention_username = username
109-
110100
events = scope.get_events() if scope else MentionScope.all_events()
111101
for event_action in events:
112102
self.add(

0 commit comments

Comments
 (0)