Wooble,

You are making two different points, I think.
1) don't store it in the datastore
2) get it using users.get_current_user().email()

Regarding #1:
I am storing it in the datastore because I want the logged-in user
user to be able to opt for a different email address -- only one, not
more. So isn't it Ok to use the datastore for that.

Regarding #2:
Aren't I doing exactly that, but in two steps in my code snippet?
step 1: user = users.get_current_user()
step 2: address = user.email()
(This may be a stupid assertion, but I am a python novice.)

Thanks very much for you reply.

On Jul 14, 10:36 am, Wooble <[email protected]> wrote:
> When you're sending the message, it needs to be addressed from either
> an admin of the application, or the email address of the currently-
> logged-in user.  You shouldn't be pulling the address to send from out
> of the datastore; using users.get_current_user().email() is probably
> the correct thing to do.
>
> On Jul 13, 5:16 pm, thebrianschott <[email protected]> wrote:
>
> > Ok, I think I see the problem, but I don't know how to fix it.
>
> > When I said in my previous message that the send mail was
> > supposed to be from "me" and to "me", I put "me" in quotes
> > because "me" is any gmail owner. Now it seems that one of the
> > gmail owners must have supplied a bad gmail address or something,
> > because the error message I posted does continue to occur for this
> > gmail owner. (Btw, the owner is called user in my code, below.)
>
> > So below is a snippet of code which I hope is all that is important
> > to show how I am getting the owner's email address initially (later,
> > I permit the owner to supply an alternative email address, but that
> > does not seem to be relevant for this owner's case).
>
> > Can anyone see how this code could produce an address that is not
> > working?
>
> > Thanks, again,
>
> > Brian in Atlanta
>
> > class Person(db.Model):
> >     date = db.DateTimeProperty(auto_now_add=True)
> >     user = db.UserProperty()
> >     address = db.EmailProperty()
>
> > class MainHandler(webapp.RequestHandler):
>
> >     def get(self):
> >         ID_id = self.request.get("ID", None)
> >         user = users.get_current_user()
> >         logging.info("ID_id %s" % ID_id)
> >         if ID_id is None: #no ID has been set by the user
> >             #irrelevant stuff
> >         else: #some ID has been set by the person
> >                     key = db.Key.from_path("Person", ID_id)
> >                     if user: #user needs to create the page
> >                         person= Person(key_name=ID_id)
> >                         person.ID = ID_id
> >                         person.user = user
> >                         address = user.email()
> >                         if person.address is None:
> >                             person.address = address
> >                         person.put()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to