File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -202,13 +202,18 @@ async def send_trial_end_reminder(
202
202
print (
203
203
f"Subscription not found for organization ID { org .id } with sub id { reminder .subId } "
204
204
)
205
- raise HTTPException (status_code = 404 , detail = "subscription_not_found" )
205
+ raise HTTPException (status_code = 500 , detail = "subscription_not_found" )
206
206
207
207
if not org .subscription .futureCancelDate :
208
208
print (f"Future cancel date not found for subscription ID { reminder .subId } " )
209
- raise HTTPException (status_code = 404 , detail = "future_cancel_date_not_found" )
209
+ raise HTTPException (status_code = 500 , detail = "future_cancel_date_not_found" )
210
210
211
211
users = await self .org_ops .get_users_for_org (org , UserRole .OWNER )
212
+
213
+ if len (users ) == 0 :
214
+ print (f"No admin users found for organization ID { org .id } " )
215
+ raise HTTPException (status_code = 500 , detail = "no_admin_users_found" )
216
+
212
217
await asyncio .gather (
213
218
* [
214
219
self .user_manager .email .send_subscription_trial_ending_soon (
You can’t perform that action at this time.
0 commit comments