Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Sep 28, 2024
1 parent ca01e0d commit 172e2d7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions keel_telegram_bot/bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,17 @@ async def _list_tracked_callback(
message = update.effective_message
chat_id = update.effective_chat.id

def filter_tracked_images_by(resources: List[TrackedImage], glob: str or None) -> List[TrackedImage]:
result = resources
def filter_tracked_images_by(images: List[TrackedImage], glob: str or None) -> List[TrackedImage]:
result = images
if glob is not None:
result = list(filter(
lambda x: re.search(glob, x.image) or re.search(glob, x.namespace) or re.search(glob,
x.policy.value) or any(
list(map(lambda y: re.search(glob, y), x.images))), resources))
lambda x: re.search(glob, x.image) or
re.search(glob, x.namespace) or
re.search(glob, x.policy.value)
))

# apply limit
result = result[:limit]
# apply limit
result = result[:limit]

return result

Expand Down

0 comments on commit 172e2d7

Please sign in to comment.