mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend): filter out DONE/CANCELED waitlists before sending notifications
The notify_waitlist_users_on_launch function was not filtering by waitlist status, which could cause duplicate notifications when an agent is re-approved. Now excludes DONE and CANCELED waitlists, consistent with get_waitlist() and add_user_to_waitlist(). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2438,17 +2438,24 @@ async def notify_waitlist_users_on_launch(
|
||||
logger.info(f"Notifying waitlist users for store listing {store_listing_id}")
|
||||
|
||||
try:
|
||||
# Find all waitlists linked to this store listing
|
||||
# Find all active waitlists linked to this store listing
|
||||
# Exclude DONE and CANCELED to prevent duplicate notifications on re-approval
|
||||
waitlists = await prisma.models.WaitlistEntry.prisma().find_many(
|
||||
where={
|
||||
"storeListingId": store_listing_id,
|
||||
"isDeleted": False,
|
||||
"status": {
|
||||
"not_in": [
|
||||
prisma.enums.WaitlistExternalStatus.DONE,
|
||||
prisma.enums.WaitlistExternalStatus.CANCELED,
|
||||
]
|
||||
},
|
||||
},
|
||||
include={"joinedUsers": True},
|
||||
)
|
||||
|
||||
if not waitlists:
|
||||
logger.info(f"No waitlists found for store listing {store_listing_id}")
|
||||
logger.info(f"No active waitlists found for store listing {store_listing_id}")
|
||||
return 0
|
||||
|
||||
notification_count = 0
|
||||
|
||||
Reference in New Issue
Block a user