I use 'current' in a function in a model like this:
=============================================
def send_email_message_web2py(
reply_to,
reply_to_email_addr,
sender_organization,
sender_name,
sender_email_addr,
sender_phone_work,
to_name,
to_email_addr,
template,
subject,
message_body,
attachments=None,
cc=None,
bcc=None,
):
from gluon import current
request = current.request #'local' object has no attribute 'request'
response = current.response
mail=current.app.mail
=============================================
With GAE 'deferred' I get sometimes the error: 'local' object has no
attribute 'request', sometimes it works. This 'sometimes' is the issue.