def test_email(email_to: EmailStr, current_user: UserInDB = Depends(get_current_active_superuser)): """ Test emails """ send_test_email(email_to=email_to) return {"msg": "Test email sent"}
def route_test_email(email_to): current_user = get_current_user() # type: User if not current_user: abort(400, "Could not authenticate user with provided token") elif not check_if_user_is_superuser(current_user): abort(400, "Not a superuser") send_test_email(email_to=email_to) return ({"msg": "Test email sent"}, 201)
def test_email( email_to: EmailStr, current_user: models.User = Depends(deps.get_current_active_superuser), ) -> Any: """ Test emails. """ send_test_email(email_to=email_to) return {"msg": "Test email sent"}
def route_test_email( email_to: EmailStr, current_user: UserInDB = Depends(get_current_user) ): """ Test emails """ if not check_if_user_is_superuser(current_user): raise HTTPException(status_code=400, detail="Not a superuser") send_test_email(email_to=email_to) return {"msg": "Test email sent"}
def test_email( email_to: EmailStr, current_user: schemas.User = Depends(auth.get_current_active_superuser), ) -> Any: """ Test emails. """ send_test_email(email_to=email_to) msg = schemas.Msg(msg="Test email sent") return msg
async def test_email( email_to: EmailStr, # pylint: disable=unused-argument current_user: UserInDB = Depends(get_current_active_superuser) ): """ Test emails. """ send_test_email(email_to=email_to) return {"msg": "Test email task sent"}
def send_test_email(ctx): sender = settings.EMAILS_FROM_EMAIL send_test_email(sender)