announcements: use get_list WebRequest method

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-02-24 08:06:22 -05:00
parent 734351d9a0
commit bc7e7d4548
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 1 additions and 6 deletions

View File

@ -143,12 +143,7 @@ class Announcements:
async def _handle_update_request(
self, web_request: WebRequest
) -> Dict[str, Any]:
subs: Optional[Union[str, List[str]]]
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())
subs = web_request.get_list("subscriptions", list(self.subscriptions.keys()))
for sub in subs:
if sub not in self.subscriptions:
raise self.server.error(f"No subscription for {sub}")