1. & - is bitwise operator (just in case)
2. why not just  return ('My message', oper and abit)

On Thursday, June 20, 2019 at 8:30:30 PM UTC+3, Константин Комков wrote:
>
> I need add more information. Can error may be caused if my function don't 
> have one condition:
> def send_application(msg,entrant_XML):
>     #Letter for operator
>     try:
>         oper = mail.send('[email protected] <javascript:>','Theme','Letter 
> text...',attachments = files)
>     except Exception:
>         oper = False
>
>     #Letter for entrant
>     try:
>         abit = mail.send(session.abit_email,'Theme','Letter text...')
>     except Exception:
>         abit = False
>
>     if ((oper==True) & (abit==True)):
>         return ('My message',True)
>     elif ((oper==True) & (abit==False)):
>         return ('My message',False)
>     elif ((oper==False) & (abit==True)):
>         return ('My message',False)
> Here I don't have that:
>     else ((False) & (False)):
>         return ('My message',False)
> Now I get return ('My message',True) in 25 percent of the time. How can I 
> improve that result? Maybe I need take several attemts, but without sending 
> two the same letter on one email. We have own mail server.
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/210e523e-0978-4d83-9418-1ddde4ff5dc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to