fix(zulip): pass Platform enum instead of string to BasePlatformAdapter.__init__
Root cause of 'str' object has no attribute 'value' error during connect():
the adapter passed a raw string 'zulip' to the base class's platform
parameter, which expects a Platform enum instance. When self.name was
accessed (calling self.platform.value.title()), the string had no .value
attribute.
Fix: import Platform from gateway.config and wrap with Platform('zulip').
This commit is contained in:
@@ -43,7 +43,7 @@ except ImportError:
|
||||
HTTPX_AVAILABLE = False
|
||||
httpx = None
|
||||
|
||||
from gateway.config import PlatformConfig
|
||||
from gateway.config import Platform, PlatformConfig
|
||||
from gateway.platforms.base import (
|
||||
BasePlatformAdapter,
|
||||
MessageEvent,
|
||||
@@ -118,8 +118,8 @@ class ZulipAdapter(BasePlatformAdapter):
|
||||
"""
|
||||
|
||||
def __init__(self, config: PlatformConfig):
|
||||
platform_name = "zulip"
|
||||
super().__init__(config=config, platform=platform_name)
|
||||
platform = Platform("zulip")
|
||||
super().__init__(config=config, platform=platform)
|
||||
|
||||
extra = config.extra or {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user