Skip to content

Commit

Permalink
remove eligibility check in sending handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Deutscher775 committed Oct 31, 2024
1 parent 8bac390 commit 5b9bc81
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/astroidapi/sending_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@ def __init__(self):
async def distribute(cls, endpoint, updated_json):
try:
sender = updated_json["meta"]["sender"]

registered_platforms = [platform for platform in updated_json["config"]["channels"] if len(updated_json["config"]["channels"][platform]) > 0]

is_eligible = await surrealdb_handler.AttachmentProcessor.check_eligibility(endpoint)

print(f"Is eligible: {is_eligible}")
if is_eligible is True:
if len(updated_json["meta"]["message"]["attachments"]) > 0:
attachments = []
for attachment in updated_json["meta"]["message"]["attachments"]:
file = await attachment_processor.download_attachment(attachment, registered_platforms)
attachments.append(file)
else:
attachments = None

if len(updated_json["meta"]["message"]["attachments"]) > 0:
attachments = []
for attachment in updated_json["meta"]["message"]["attachments"]:
file = await attachment_processor.download_attachment(attachment, registered_platforms)
attachments.append(file)
else:
attachments = None

Expand Down

0 comments on commit 5b9bc81

Please sign in to comment.