Fix AttributeError

This commit is contained in:
vas3k
2020-02-26 10:46:01 +01:00
parent b65c3a010a
commit e4a108d3a5

View File

@@ -14,11 +14,11 @@ class TelegramChannelFeed(Feed):
only = str(request.GET.get("only") or "")
if only:
try:
only = [MessageType[item.strip()] for item in only.split(",")]
only = [MessageType(item.strip()) for item in only.split(",")]
except (KeyError, ValueError):
raise HttpResponseBadRequest()
return HttpResponseBadRequest()
limit = 100 # dirty hack: artificially increase the limit to get more filtered messages
limit = 100 # dirty hack: artificially increase the limit to get more messages after filtering
try:
return get_channel(channel, types=only, limit=limit)