Use enum instead of strings
This commit is contained in:
@@ -3,17 +3,19 @@ from django.http import Http404
|
||||
|
||||
from parsing.exceptions import ParsingException
|
||||
from parsing.telegram.telegram import get_channel
|
||||
from parsing.telegram.models import MessageType
|
||||
|
||||
|
||||
class TelegramChannelFeed(Feed):
|
||||
|
||||
FEED_ITEMS = 30
|
||||
|
||||
def get_object(self, request, channel):
|
||||
limit = int(request.GET.get("size") or self.FEED_ITEMS)
|
||||
only = str(request.GET.get("only") or "")
|
||||
if only:
|
||||
only = [item.strip() for item in only.split(",")]
|
||||
only = [
|
||||
MessageType.get(item.strip()) for item in only.split(",")
|
||||
]
|
||||
limit = 100 # dirty hack: artificially increase the limit to get more filtered messages
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user