announcements: use get_list WebRequest method
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
734351d9a0
commit
bc7e7d4548
|
@ -143,12 +143,7 @@ class Announcements:
|
||||||
async def _handle_update_request(
|
async def _handle_update_request(
|
||||||
self, web_request: WebRequest
|
self, web_request: WebRequest
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
subs: Optional[Union[str, List[str]]]
|
subs = web_request.get_list("subscriptions", list(self.subscriptions.keys()))
|
||||||
subs = web_request.get("subscriptions", None)
|
|
||||||
if isinstance(subs, str):
|
|
||||||
subs = [sub.strip() for sub in subs.split(",") if sub.strip()]
|
|
||||||
elif subs is None:
|
|
||||||
subs = list(self.subscriptions.keys())
|
|
||||||
for sub in subs:
|
for sub in subs:
|
||||||
if sub not in self.subscriptions:
|
if sub not in self.subscriptions:
|
||||||
raise self.server.error(f"No subscription for {sub}")
|
raise self.server.error(f"No subscription for {sub}")
|
||||||
|
|
Loading…
Reference in New Issue